Changeset 36104 in vbox
- Timestamp:
- Feb 28, 2011 4:55:24 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r35940 r36104 7 7 8 8 /* 9 * Copyright (C) 2006-201 0Oracle Corporation9 * Copyright (C) 2006-2011 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 2973 2973 tr ("VDE Adapter", "NetworkAttachmentType"); 2974 2974 #endif 2975 2976 mNetworkAdapterPromiscModePolicyTypes [KNetworkAdapterPromiscModePolicy_Deny] = 2977 tr ("Deny", "NetworkAdapterPromiscModePolicyType"); 2978 mNetworkAdapterPromiscModePolicyTypes [KNetworkAdapterPromiscModePolicy_AllowNetwork] = 2979 tr ("Allow Network", "NetworkAdapterPromiscModePolicyType"); 2980 mNetworkAdapterPromiscModePolicyTypes [KNetworkAdapterPromiscModePolicy_AllowAll] = 2981 tr ("Allow All", "NetworkAdapterPromiscModePolicyType"); 2975 2982 2976 2983 mNATProtocolTypes [KNATProtocol_UDP] = -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r35940 r36104 6 6 7 7 /* 8 * Copyright (C) 2006-201 0Oracle Corporation8 * Copyright (C) 2006-2011 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 482 482 } 483 483 484 QString toString (KNetworkAdapterPromiscModePolicy t) const 485 { 486 AssertMsg (!mNetworkAdapterPromiscModePolicyTypes.value (t).isNull(), ("No text for %d", t)); 487 return mNetworkAdapterPromiscModePolicyTypes.value (t); 488 } 489 490 KNetworkAdapterPromiscModePolicy toNetworkAdapterPromiscModePolicyType (const QString &s) const 491 { 492 QULongStringHash::const_iterator it = 493 qFind (mNetworkAdapterPromiscModePolicyTypes.begin(), mNetworkAdapterPromiscModePolicyTypes.end(), s); 494 AssertMsg (it != mNetworkAdapterPromiscModePolicyTypes.end(), ("No value for {%s}", 495 s.toLatin1().constData())); 496 return KNetworkAdapterPromiscModePolicy (it.key()); 497 } 498 484 499 QString toString (KNATProtocol t) const 485 500 { … … 854 869 QULongStringHash mNetworkAdapterTypes; 855 870 QULongStringHash mNetworkAttachmentTypes; 871 QULongStringHash mNetworkAdapterPromiscModePolicyTypes; 856 872 QULongStringHash mNATProtocolTypes; 857 873 QULongStringHash mClipboardTypes; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp
r35761 r36104 7 7 8 8 /* 9 * Copyright (C) 2008-201 0Oracle Corporation9 * Copyright (C) 2008-2011 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 18 18 */ 19 19 20 /* VBox Includes */ 21 #ifdef VBOX_WITH_VDE 22 # include <iprt/ldr.h> 23 # include <VBox/VDEPlug.h> 24 #endif 25 20 /* Qt includes */ 21 #include <QTimer> 22 #include <QCompleter> 23 24 /* Local includes */ 26 25 #include "QIWidgetValidator.h" 27 26 #include "QIArrowButtonSwitch.h" … … 30 29 #include "QITabWidget.h" 31 30 32 /* Qt Includes */ 33 #include <QTimer> 34 #include <QCompleter> 35 36 /* Empty item extra-code */ 31 #ifdef VBOX_WITH_VDE 32 # include <iprt/ldr.h> 33 # include <VBox/VDEPlug.h> 34 #endif /* VBOX_WITH_VDE */ 35 36 /* Empty item extra-code: */ 37 37 const char *emptyItemCode = "#empty#"; 38 38 39 /* UIMachineSettingsNetwork Stuff */ 40 UIMachineSettingsNetwork::UIMachineSettingsNetwork (UIMachineSettingsNetworkPage *aParent, bool aDisableStaticControls) 41 : QIWithRetranslateUI <QWidget> (0) 42 , mParent (aParent) 43 , mValidator (0) 39 UIMachineSettingsNetwork::UIMachineSettingsNetwork(UIMachineSettingsNetworkPage *pParent, bool fDisableStaticControls) 40 : QIWithRetranslateUI<QWidget>(0) 41 , m_pParent(pParent) 42 , m_pValidator(0) 44 43 , m_iSlot(-1) 45 , mPolished (false) 46 , mDisableStaticControls (false) 47 { 48 /* Apply UI decorations */ 49 Ui::UIMachineSettingsNetwork::setupUi (this); 50 51 /* Setup widgets */ 52 mCbAdapterName->setInsertPolicy (QComboBox::NoInsert); 53 mLeMAC->setValidator (new QRegExpValidator (QRegExp ( 54 "[0-9A-Fa-f][02468ACEace][0-9A-Fa-f]{10}"), this)); 55 mLeMAC->setMinimumWidthByText (QString().fill ('0', 12)); 56 57 /* Setup connections */ 58 connect (mAbsAdvanced, SIGNAL (clicked()), this, SLOT (toggleAdvanced())); 59 connect (mTbMAC, SIGNAL (clicked()), this, SLOT (generateMac())); 60 connect (mPbPortForwarding, SIGNAL (clicked()), this, SLOT (sltOpenPortForwardingDlg())); 61 62 /* Applying language settings */ 44 , m_fPolished(false) 45 , m_fDisableStaticControls(fDisableStaticControls) 46 { 47 /* Apply UI decorations: */ 48 Ui::UIMachineSettingsNetwork::setupUi(this); 49 50 /* Setup widgets: */ 51 m_pAdapterNameCombo->setInsertPolicy(QComboBox::NoInsert); 52 m_pMACEditor->setValidator(new QRegExpValidator(QRegExp("[0-9A-Fa-f][02468ACEace][0-9A-Fa-f]{10}"), this)); 53 m_pMACEditor->setMinimumWidthByText(QString().fill('0', 12)); 54 55 /* Setup connections: */ 56 connect(m_pAdvancedArrow, SIGNAL(clicked()), this, SLOT(sltToggleAdvanced())); 57 connect(m_pMACButton, SIGNAL(clicked()), this, SLOT(sltGenerateMac())); 58 connect(m_pPortForwardingButton, SIGNAL(clicked()), this, SLOT(sltOpenPortForwardingDlg())); 59 60 /* Applying language settings: */ 63 61 retranslateUi(); 64 65 /* If some controls should be disabled or not when the66 * same tab widgets are shown during runtime67 */68 mDisableStaticControls = aDisableStaticControls;69 62 } 70 63 … … 78 71 mCbEnableAdapter->setChecked(data.m_fAdapterEnabled); 79 72 80 /* Load adapter type: */81 int adapterPos = mCbAdapterType->findData(data.m_adapterType);82 mCbAdapterType->setCurrentIndex(adapterPos == -1 ? 0 : adapterPos);83 84 73 /* Load attachment type: */ 85 int attachmentPos = mCbAttachmentType->findData(data.m_attachmentType);86 m CbAttachmentType->setCurrentIndex(attachmentPos == -1 ? 0 : attachmentPos);74 int iAttachmentPos = m_pAttachmentTypeCombo->findData(data.m_attachmentType); 75 m_pAttachmentTypeCombo->setCurrentIndex(iAttachmentPos == -1 ? 0 : iAttachmentPos); 87 76 88 77 /* Load alternative name: */ … … 90 79 { 91 80 case KNetworkAttachmentType_Bridged: 92 m BrgName = data.m_strBridgedAdapterName;93 if (m BrgName.isEmpty()) mBrgName = QString();81 m_strBrgName = data.m_strBridgedAdapterName; 82 if (m_strBrgName.isEmpty()) m_strBrgName = QString(); 94 83 break; 95 84 case KNetworkAttachmentType_Internal: 96 m IntName = data.m_strInternalNetworkName;97 if (m IntName.isEmpty()) mIntName = QString();85 m_strIntName = data.m_strInternalNetworkName; 86 if (m_strIntName.isEmpty()) m_strIntName = QString(); 98 87 break; 99 88 case KNetworkAttachmentType_HostOnly: 100 m HoiName = data.m_strHostInterfaceName;101 if (m HoiName.isEmpty()) mHoiName = QString();89 m_strHoiName = data.m_strHostInterfaceName; 90 if (m_strHoiName.isEmpty()) m_strHoiName = QString(); 102 91 break; 103 92 #ifdef VBOX_WITH_VDE … … 110 99 break; 111 100 } 112 updateAttachmentAlternative(); 101 sltUpdateAttachmentAlternative(); 102 103 /* Load adapter type: */ 104 int iAdapterPos = m_pAdapterTypeCombo->findData(data.m_adapterType); 105 m_pAdapterTypeCombo->setCurrentIndex(iAdapterPos == -1 ? 0 : iAdapterPos); 106 107 /* Load promiscuous mode type: */ 108 int iPromiscuousModePos = m_pPromiscuousModeCombo->findData(data.m_promiscuousMode); 109 m_pPromiscuousModeCombo->setCurrentIndex(iPromiscuousModePos == -1 ? 0 : iPromiscuousModePos); 113 110 114 111 /* Other options: */ 115 m LeMAC->setText(data.m_strMACAddress);116 m CbCableConnected->setChecked(data.m_fCableConnected);112 m_pMACEditor->setText(data.m_strMACAddress); 113 m_pCableConnectedCheckBox->setChecked(data.m_fCableConnected); 117 114 118 115 /* Load port forwarding rules: */ 119 m PortForwardingRules = data.m_redirects;116 m_portForwardingRules = data.m_redirects; 120 117 } 121 118 … … 124 121 /* Save adapter activity state: */ 125 122 data.m_fAdapterEnabled = mCbEnableAdapter->isChecked(); 126 127 /* Save adapter type: */128 data.m_adapterType = (KNetworkAdapterType)mCbAdapterType->itemData(mCbAdapterType->currentIndex()).toInt();129 123 130 124 /* Save attachment type & alternative name: */ … … 154 148 } 155 149 150 /* Save adapter type: */ 151 data.m_adapterType = (KNetworkAdapterType)m_pAdapterTypeCombo->itemData(m_pAdapterTypeCombo->currentIndex()).toInt(); 152 153 /* Save promiscuous mode type: */ 154 data.m_promiscuousMode = (KNetworkAdapterPromiscModePolicy)m_pPromiscuousModeCombo->itemData(m_pPromiscuousModeCombo->currentIndex()).toInt(); 155 156 156 /* Other options: */ 157 data.m_strMACAddress = m LeMAC->text().isEmpty() ? QString() : mLeMAC->text();158 data.m_fCableConnected = m CbCableConnected->isChecked();157 data.m_strMACAddress = m_pMACEditor->text().isEmpty() ? QString() : m_pMACEditor->text(); 158 data.m_fCableConnected = m_pCableConnectedCheckBox->isChecked(); 159 159 160 160 /* Save port forwarding rules: */ 161 data.m_redirects = mPortForwardingRules; 162 } 163 164 void UIMachineSettingsNetwork::setValidator (QIWidgetValidator *aValidator) 165 { 166 mValidator = aValidator; 167 168 if (!mDisableStaticControls) 169 connect (mCbEnableAdapter, SIGNAL (toggled (bool)), 170 mValidator, SLOT (revalidate())); 171 connect (mCbAttachmentType, SIGNAL (activated (const QString&)), 172 this, SLOT (updateAttachmentAlternative())); 173 connect (mCbAdapterName, SIGNAL (activated (const QString&)), 174 this, SLOT (updateAlternativeName())); 175 connect (mCbAdapterName, SIGNAL (editTextChanged (const QString&)), 176 this, SLOT (updateAlternativeName())); 177 178 if (!mDisableStaticControls) 179 mValidator->revalidate(); 180 } 181 182 bool UIMachineSettingsNetwork::revalidate (QString &aWarning, QString &aTitle) 183 { 184 /* 'True' for disabled adapter */ 161 data.m_redirects = m_portForwardingRules; 162 } 163 164 void UIMachineSettingsNetwork::setValidator(QIWidgetValidator *pValidator) 165 { 166 m_pValidator = pValidator; 167 168 if (!m_fDisableStaticControls) 169 connect(mCbEnableAdapter, SIGNAL(toggled(bool)), m_pValidator, SLOT(revalidate())); 170 connect(m_pAttachmentTypeCombo, SIGNAL(activated(const QString&)), this, SLOT(sltUpdateAttachmentAlternative())); 171 connect(m_pAdapterNameCombo, SIGNAL(activated(const QString&)), this, SLOT(sltUpdateAlternativeName())); 172 connect(m_pAdapterNameCombo, SIGNAL(editTextChanged(const QString&)), this, SLOT(sltUpdateAlternativeName())); 173 174 if (!m_fDisableStaticControls) 175 m_pValidator->revalidate(); 176 } 177 178 bool UIMachineSettingsNetwork::revalidate(QString &strWarning, QString &strTitle) 179 { 180 /* 'True' for disabled adapter: */ 185 181 if (!mCbEnableAdapter->isChecked()) 186 182 return true; 187 183 188 /* Validate alternatives */189 bool valid = true;184 /* Validate alternatives: */ 185 bool fValid = true; 190 186 switch (attachmentType()) 191 187 { … … 193 189 if (alternativeName().isNull()) 194 190 { 195 aWarning = tr("no bridged network adapter is selected");196 valid = false;191 strWarning = tr("no bridged network adapter is selected"); 192 fValid = false; 197 193 } 198 194 break; … … 200 196 if (alternativeName().isNull()) 201 197 { 202 aWarning = tr("no internal network name is specified");203 valid = false;198 strWarning = tr("no internal network name is specified"); 199 fValid = false; 204 200 } 205 201 break; … … 207 203 if (alternativeName().isNull()) 208 204 { 209 aWarning = tr("no host-only network adapter is selected");210 valid = false;205 strWarning = tr("no host-only network adapter is selected"); 206 fValid = false; 211 207 } 212 208 break; … … 214 210 break; 215 211 } 216 217 if (!valid)218 aTitle += ": " + vboxGlobal().removeAccelMark (pageTitle()); 219 220 return valid; 221 } 222 223 QWidget* UIMachineSettingsNetwork::setOrderAfter (QWidget *aAfter) 224 { 225 setTabOrder (aAfter, mCbEnableAdapter);226 setTabOrder (mCbEnableAdapter, mCbAttachmentType);227 setTabOrder (mCbAttachmentType, mCbAdapterName);228 setTabOrder (mCbAdapterName, mAbsAdvanced);229 setTabOrder (mAbsAdvanced, mCbAdapterType);230 setTabOrder (mCbAdapterType, mLeMAC);231 setTabOrder (mLeMAC, mTbMAC);232 setTabOrder (mTbMAC, mCbCableConnected);233 setTabOrder (mCbCableConnected, mPbPortForwarding);234 return m PbPortForwarding;212 if (!fValid) 213 strTitle += ": " + vboxGlobal().removeAccelMark(pageTitle()); 214 215 return fValid; 216 } 217 218 QWidget* UIMachineSettingsNetwork::setOrderAfter(QWidget *pAfter) 219 { 220 setTabOrder(pAfter, mCbEnableAdapter); 221 setTabOrder(mCbEnableAdapter, m_pAttachmentTypeCombo); 222 setTabOrder(m_pAttachmentTypeCombo, m_pAdapterNameCombo); 223 setTabOrder(m_pAdapterNameCombo, m_pAdvancedArrow); 224 setTabOrder(m_pAdvancedArrow, m_pAdapterTypeCombo); 225 setTabOrder(m_pAdapterTypeCombo, m_pPromiscuousModeCombo); 226 setTabOrder(m_pPromiscuousModeCombo, m_pMACEditor); 227 setTabOrder(m_pMACEditor, m_pMACButton); 228 setTabOrder(m_pMACButton, m_pCableConnectedCheckBox); 229 setTabOrder(m_pCableConnectedCheckBox, m_pPortForwardingButton); 230 return m_pPortForwardingButton; 235 231 } 236 232 … … 242 238 KNetworkAttachmentType UIMachineSettingsNetwork::attachmentType() const 243 239 { 244 return (KNetworkAttachmentType) mCbAttachmentType->itemData (245 mCbAttachmentType->currentIndex()).toInt(); 246 } 247 248 QString UIMachineSettingsNetwork::alternativeName (int aType) const 249 { 250 if (aType == -1) aType = attachmentType();251 QString result;252 switch ( aType)240 return (KNetworkAttachmentType)m_pAttachmentTypeCombo->itemData(m_pAttachmentTypeCombo->currentIndex()).toInt(); 241 } 242 243 QString UIMachineSettingsNetwork::alternativeName(int type) const 244 { 245 if (type == -1) 246 type = attachmentType(); 247 QString strResult; 248 switch (type) 253 249 { 254 250 case KNetworkAttachmentType_Bridged: 255 result = mBrgName;251 strResult = m_strBrgName; 256 252 break; 257 253 case KNetworkAttachmentType_Internal: 258 result = mIntName;254 strResult = m_strIntName; 259 255 break; 260 256 case KNetworkAttachmentType_HostOnly: 261 result = mHoiName;257 strResult = m_strHoiName; 262 258 break; 263 259 #ifdef VBOX_WITH_VDE 264 260 case KNetworkAttachmentType_VDE: 265 result = mVDEName;261 strResult = mVDEName; 266 262 break; 267 263 #endif … … 269 265 break; 270 266 } 271 Assert (result.isNull() || !result.isEmpty()); 272 return result; 273 } 274 275 void UIMachineSettingsNetwork::showEvent (QShowEvent *aEvent) 276 { 277 if (!mPolished) 278 { 279 mPolished = true; 280 281 /* Give the minimum size hint to the first layout column */ 282 mNetworkChildGridLayout->setColumnMinimumWidth (0, mLbAttachmentType->width()); 283 284 if (mDisableStaticControls) 285 { 286 /* Disable controls for dynamically displayed page */ 287 mCbEnableAdapter->setEnabled (false); 288 mCbAdapterType->setEnabled (false); 289 mLeMAC->setEnabled (false); 290 mTbMAC->setEnabled (false); 291 mLbAdapterType->setEnabled (false); 292 mLbMAC->setEnabled (false); 293 mAbsAdvanced->animateClick(); 267 Assert(strResult.isNull() || !strResult.isEmpty()); 268 return strResult; 269 } 270 271 void UIMachineSettingsNetwork::showEvent(QShowEvent *pEvent) 272 { 273 if (!m_fPolished) 274 { 275 m_fPolished = true; 276 277 /* Give the minimum size hint to the first layout column: */ 278 m_pNetworkChildGridLayout->setColumnMinimumWidth (0, m_pAttachmentTypeLabel->width()); 279 280 if (m_fDisableStaticControls) 281 { 282 /* Disable controls for dynamically displayed page: */ 283 mCbEnableAdapter->setEnabled(false); 284 m_pAdapterTypeCombo->setEnabled(false); 285 m_pPromiscuousModeCombo->setEnabled(false); 286 m_pMACEditor->setEnabled(false); 287 m_pMACButton->setEnabled(false); 288 m_pAdapterTypeLabel->setEnabled(false); 289 m_pPromiscuousModeLabel->setEnabled(false); 290 m_pMACLabel->setEnabled(false); 291 m_pAdvancedArrow->animateClick(); 294 292 } 295 293 else 296 294 { 297 /* Hide advanced items initially */298 toggleAdvanced();299 } 300 } 301 QWidget::showEvent (aEvent);295 /* Hide advanced items initially: */ 296 sltToggleAdvanced(); 297 } 298 } 299 QWidget::showEvent(pEvent); 302 300 } 303 301 304 302 void UIMachineSettingsNetwork::retranslateUi() 305 303 { 306 /* Translate uic generated strings */307 Ui::UIMachineSettingsNetwork::retranslateUi 308 309 /* Translate combo-boxes content */304 /* Translate uic generated strings: */ 305 Ui::UIMachineSettingsNetwork::retranslateUi(this); 306 307 /* Translate combo-boxes content: */ 310 308 populateComboboxes(); 311 309 312 /* Translate attachment info */ 313 updateAttachmentAlternative(); 314 } 315 316 void UIMachineSettingsNetwork::updateAttachmentAlternative() 317 { 318 /* Blocking signals to change content manually */ 319 mCbAdapterName->blockSignals (true); 320 321 /* Update alternative-name combo-box availability */ 322 mLbAdapterName->setEnabled (attachmentType() != KNetworkAttachmentType_Null && 323 attachmentType() != KNetworkAttachmentType_NAT); 324 mCbAdapterName->setEnabled (attachmentType() != KNetworkAttachmentType_Null && 325 attachmentType() != KNetworkAttachmentType_NAT); 326 327 /* Refresh list */ 328 mCbAdapterName->clear(); 310 /* Translate attachment info: */ 311 sltUpdateAttachmentAlternative(); 312 } 313 314 void UIMachineSettingsNetwork::sltUpdateAttachmentAlternative() 315 { 316 /* Blocking signals to change content manually: */ 317 m_pAdapterNameCombo->blockSignals(true); 318 319 /* Update alternative-name combo-box availability: */ 320 m_pAdapterNameLabel->setEnabled(attachmentType() != KNetworkAttachmentType_Null && 321 attachmentType() != KNetworkAttachmentType_NAT); 322 m_pAdapterNameCombo->setEnabled(attachmentType() != KNetworkAttachmentType_Null && 323 attachmentType() != KNetworkAttachmentType_NAT); 324 m_pPromiscuousModeLabel->setEnabled(attachmentType() != KNetworkAttachmentType_Null && 325 attachmentType() != KNetworkAttachmentType_NAT); 326 m_pPromiscuousModeCombo->setEnabled(attachmentType() != KNetworkAttachmentType_Null && 327 attachmentType() != KNetworkAttachmentType_NAT); 328 329 /* Refresh list: */ 330 m_pAdapterNameCombo->clear(); 329 331 switch (attachmentType()) 330 332 { 331 333 case KNetworkAttachmentType_Bridged: 332 m CbAdapterName->insertItems (0, mParent->brgList());333 m CbAdapterName->setEditable(false);334 m_pAdapterNameCombo->insertItems(0, m_pParent->brgList()); 335 m_pAdapterNameCombo->setEditable(false); 334 336 break; 335 337 case KNetworkAttachmentType_Internal: 336 m CbAdapterName->insertItems (0, mParent->fullIntList());337 m CbAdapterName->setEditable(true);338 m CbAdapterName->setCompleter(0);338 m_pAdapterNameCombo->insertItems(0, m_pParent->fullIntList()); 339 m_pAdapterNameCombo->setEditable(true); 340 m_pAdapterNameCombo->setCompleter(0); 339 341 break; 340 342 case KNetworkAttachmentType_HostOnly: 341 m CbAdapterName->insertItems (0, mParent->hoiList());342 m CbAdapterName->setEditable(false);343 m_pAdapterNameCombo->insertItems(0, m_pParent->hoiList()); 344 m_pAdapterNameCombo->setEditable(false); 343 345 break; 344 346 #ifdef VBOX_WITH_VDE 345 347 case KNetworkAttachmentType_VDE: 346 m CbAdapterName->insertItem(0, alternativeName());347 m CbAdapterName->setEditable(true);348 m CbAdapterName->setCompleter(0);348 m_pAdapterNameCombo->insertItem(0, alternativeName()); 349 m_pAdapterNameCombo->setEditable(true); 350 m_pAdapterNameCombo->setCompleter(0); 349 351 break; 350 352 #endif … … 353 355 } 354 356 355 /* Prepend 'empty' or 'default' item */356 if (m CbAdapterName->count() == 0)357 /* Prepend 'empty' or 'default' item: */ 358 if (m_pAdapterNameCombo->count() == 0) 357 359 { 358 360 switch (attachmentType()) … … 361 363 case KNetworkAttachmentType_HostOnly: 362 364 { 363 /* Adapters list 'empty' */364 int pos = m CbAdapterName->findData(emptyItemCode);365 /* Adapters list 'empty': */ 366 int pos = m_pAdapterNameCombo->findData(emptyItemCode); 365 367 if (pos == -1) 366 m CbAdapterName->insertItem (0, tr("Not selected", "network adapter name"), emptyItemCode);368 m_pAdapterNameCombo->insertItem(0, tr("Not selected", "network adapter name"), emptyItemCode); 367 369 else 368 m CbAdapterName->setItemText (pos, tr("Not selected", "network adapter name"));370 m_pAdapterNameCombo->setItemText(pos, tr("Not selected", "network adapter name")); 369 371 break; 370 372 } 371 373 case KNetworkAttachmentType_Internal: 372 374 { 373 /* Internal network 'default' name */374 if (m CbAdapterName->findText("intnet") == -1)375 m CbAdapterName->insertItem(0, "intnet");375 /* Internal network 'default' name: */ 376 if (m_pAdapterNameCombo->findText("intnet") == -1) 377 m_pAdapterNameCombo->insertItem(0, "intnet"); 376 378 break; 377 379 } … … 381 383 } 382 384 383 /* Select previous or default item */385 /* Select previous or default item: */ 384 386 switch (attachmentType()) 385 387 { … … 387 389 case KNetworkAttachmentType_HostOnly: 388 390 { 389 int pos = m CbAdapterName->findText(alternativeName());390 m CbAdapterName->setCurrentIndex(pos == -1 ? 0 : pos);391 int pos = m_pAdapterNameCombo->findText(alternativeName()); 392 m_pAdapterNameCombo->setCurrentIndex(pos == -1 ? 0 : pos); 391 393 break; 392 394 } 393 395 case KNetworkAttachmentType_Internal: 394 396 { 395 int pos = m CbAdapterName->findText(alternativeName());396 m CbAdapterName->setCurrentIndex(pos == -1 ? 0 : pos);397 int pos = m_pAdapterNameCombo->findText(alternativeName()); 398 m_pAdapterNameCombo->setCurrentIndex(pos == -1 ? 0 : pos); 397 399 break; 398 400 } … … 401 403 } 402 404 403 /* Remember selected item */404 updateAlternativeName();405 /* Remember selected item: */ 406 sltUpdateAlternativeName(); 405 407 406 408 /* Update Forwarding rules button availability: */ 407 m PbPortForwarding->setEnabled(attachmentType() == KNetworkAttachmentType_NAT);408 409 /* Unblocking signals as content is changed already */410 m CbAdapterName->blockSignals(false);411 } 412 413 void UIMachineSettingsNetwork:: updateAlternativeName()409 m_pPortForwardingButton->setEnabled(attachmentType() == KNetworkAttachmentType_NAT); 410 411 /* Unblocking signals as content is changed already: */ 412 m_pAdapterNameCombo->blockSignals(false); 413 } 414 415 void UIMachineSettingsNetwork::sltUpdateAlternativeName() 414 416 { 415 417 switch (attachmentType()) … … 417 419 case KNetworkAttachmentType_Bridged: 418 420 { 419 QString newName (mCbAdapterName->itemData (mCbAdapterName->currentIndex()).toString() ==420 QString(emptyItemCode) ||421 mCbAdapterName->currentText().isEmpty() ?422 QString::null : mCbAdapterName->currentText());423 if (m BrgName != newName)424 m BrgName = newName;421 QString newName(m_pAdapterNameCombo->itemData(m_pAdapterNameCombo->currentIndex()).toString() == 422 QString(emptyItemCode) || 423 m_pAdapterNameCombo->currentText().isEmpty() ? 424 QString::null : m_pAdapterNameCombo->currentText()); 425 if (m_strBrgName != newName) 426 m_strBrgName = newName; 425 427 break; 426 428 } 427 429 case KNetworkAttachmentType_Internal: 428 430 { 429 QString newName ((mCbAdapterName->itemData (mCbAdapterName->currentIndex()).toString() ==430 QString(emptyItemCode) &&431 mCbAdapterName->currentText() ==432 mCbAdapterName->itemText (mCbAdapterName->currentIndex())) ||433 mCbAdapterName->currentText().isEmpty() ?434 QString::null : mCbAdapterName->currentText());435 if (m IntName != newName)431 QString newName((m_pAdapterNameCombo->itemData(m_pAdapterNameCombo->currentIndex()).toString() == 432 QString(emptyItemCode) && 433 m_pAdapterNameCombo->currentText() == 434 m_pAdapterNameCombo->itemText(m_pAdapterNameCombo->currentIndex())) || 435 m_pAdapterNameCombo->currentText().isEmpty() ? 436 QString::null : m_pAdapterNameCombo->currentText()); 437 if (m_strIntName != newName) 436 438 { 437 m IntName = newName;438 if (!m IntName.isNull())439 QTimer::singleShot (0, mParent, SLOT (updatePages()));439 m_strIntName = newName; 440 if (!m_strIntName.isNull()) 441 QTimer::singleShot(0, m_pParent, SLOT (updatePages())); 440 442 } 441 443 break; … … 443 445 case KNetworkAttachmentType_HostOnly: 444 446 { 445 QString newName (mCbAdapterName->itemData (mCbAdapterName->currentIndex()).toString() ==446 QString(emptyItemCode) ||447 mCbAdapterName->currentText().isEmpty() ?448 QString::null : mCbAdapterName->currentText());449 if (m HoiName != newName)450 m HoiName = newName;447 QString newName(m_pAdapterNameCombo->itemData(m_pAdapterNameCombo->currentIndex()).toString() == 448 QString(emptyItemCode) || 449 m_pAdapterNameCombo->currentText().isEmpty() ? 450 QString::null : m_pAdapterNameCombo->currentText()); 451 if (m_strHoiName != newName) 452 m_strHoiName = newName; 451 453 break; 452 454 } … … 454 456 case KNetworkAttachmentType_VDE: 455 457 { 456 QString newName ((mCbAdapterName->itemData (mCbAdapterName->currentIndex()).toString() ==457 QString(emptyItemCode) &&458 mCbAdapterName->currentText() ==459 mCbAdapterName->itemText (mCbAdapterName->currentIndex())) ||460 mCbAdapterName->currentText().isEmpty() ?461 QString::null : mCbAdapterName->currentText());458 QString newName((m_pAdapterNameCombo->itemData(m_pAdapterNameCombo->currentIndex()).toString() == 459 QString(emptyItemCode) && 460 m_pAdapterNameCombo->currentText() == 461 m_pAdapterNameCombo->itemText(m_pAdapterNameCombo->currentIndex())) || 462 m_pAdapterNameCombo->currentText().isEmpty() ? 463 QString::null : m_pAdapterNameCombo->currentText()); 462 464 if (mVDEName != newName) 463 465 mVDEName = newName; … … 469 471 } 470 472 471 if (mValidator) 472 mValidator->revalidate(); 473 } 474 475 void UIMachineSettingsNetwork::toggleAdvanced() 476 { 477 mLbAdapterType->setVisible (mAbsAdvanced->isExpanded()); 478 mCbAdapterType->setVisible (mAbsAdvanced->isExpanded()); 479 mLbMAC->setVisible (mAbsAdvanced->isExpanded()); 480 mLeMAC->setVisible (mAbsAdvanced->isExpanded()); 481 mTbMAC->setVisible (mAbsAdvanced->isExpanded()); 482 mCbCableConnected->setVisible (mAbsAdvanced->isExpanded()); 483 mPbPortForwarding->setVisible (mAbsAdvanced->isExpanded()); 484 } 485 486 void UIMachineSettingsNetwork::generateMac() 473 if (m_pValidator) 474 m_pValidator->revalidate(); 475 } 476 477 void UIMachineSettingsNetwork::sltToggleAdvanced() 478 { 479 m_pAdapterTypeLabel->setVisible(m_pAdvancedArrow->isExpanded()); 480 m_pAdapterTypeCombo->setVisible(m_pAdvancedArrow->isExpanded()); 481 m_pPromiscuousModeLabel->setVisible(m_pAdvancedArrow->isExpanded()); 482 m_pPromiscuousModeCombo->setVisible(m_pAdvancedArrow->isExpanded()); 483 m_pMACLabel->setVisible(m_pAdvancedArrow->isExpanded()); 484 m_pMACEditor->setVisible(m_pAdvancedArrow->isExpanded()); 485 m_pMACButton->setVisible(m_pAdvancedArrow->isExpanded()); 486 m_pCableConnectedCheckBox->setVisible(m_pAdvancedArrow->isExpanded()); 487 m_pPortForwardingButton->setVisible(m_pAdvancedArrow->isExpanded()); 488 } 489 490 void UIMachineSettingsNetwork::sltGenerateMac() 487 491 { 488 492 m_adapter.SetMACAddress(QString::null); 489 m LeMAC->setText(m_adapter.GetMACAddress());493 m_pMACEditor->setText(m_adapter.GetMACAddress()); 490 494 } 491 495 492 496 void UIMachineSettingsNetwork::sltOpenPortForwardingDlg() 493 497 { 494 UIMachineSettingsPortForwardingDlg dlg(this, m PortForwardingRules);498 UIMachineSettingsPortForwardingDlg dlg(this, m_portForwardingRules); 495 499 if (dlg.exec() == QDialog::Accepted) 496 m PortForwardingRules = dlg.rules();500 m_portForwardingRules = dlg.rules(); 497 501 } 498 502 499 503 void UIMachineSettingsNetwork::populateComboboxes() 500 504 { 501 /* Save the current selected adapter */ 502 int currentAdapter = mCbAdapterType->currentIndex(); 503 504 /* Clear the adapters combo-box */ 505 mCbAdapterType->clear(); 506 507 /* Populate adapters */ 508 mCbAdapterType->insertItem (0, 509 vboxGlobal().toString (KNetworkAdapterType_Am79C970A)); 510 mCbAdapterType->setItemData (0, 511 KNetworkAdapterType_Am79C970A); 512 mCbAdapterType->setItemData (0, 513 mCbAdapterType->itemText (0), Qt::ToolTipRole); 514 mCbAdapterType->insertItem (1, 515 vboxGlobal().toString (KNetworkAdapterType_Am79C973)); 516 mCbAdapterType->setItemData (1, 517 KNetworkAdapterType_Am79C973); 518 mCbAdapterType->setItemData (1, 519 mCbAdapterType->itemText (1), Qt::ToolTipRole); 505 /* Attachment type: */ 506 { 507 /* Remember the currently selected attachment type: */ 508 int iCurrentAttachment = m_pAttachmentTypeCombo->currentIndex(); 509 510 /* Clear the attachments combo-box: */ 511 m_pAttachmentTypeCombo->clear(); 512 513 /* Populate attachments: */ 514 int iAttachmentTypeIndex = 0; 515 m_pAttachmentTypeCombo->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_Null)); 516 m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Null); 517 m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeCombo->itemText(iAttachmentTypeIndex), Qt::ToolTipRole); 518 ++iAttachmentTypeIndex; 519 m_pAttachmentTypeCombo->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_NAT)); 520 m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_NAT); 521 m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeCombo->itemText(iAttachmentTypeIndex), Qt::ToolTipRole); 522 ++iAttachmentTypeIndex; 523 m_pAttachmentTypeCombo->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_Bridged)); 524 m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Bridged); 525 m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeCombo->itemText(iAttachmentTypeIndex), Qt::ToolTipRole); 526 ++iAttachmentTypeIndex; 527 m_pAttachmentTypeCombo->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_Internal)); 528 m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Internal); 529 m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeCombo->itemText(iAttachmentTypeIndex), Qt::ToolTipRole); 530 ++iAttachmentTypeIndex; 531 m_pAttachmentTypeCombo->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_HostOnly)); 532 m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_HostOnly); 533 m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeCombo->itemText(iAttachmentTypeIndex), Qt::ToolTipRole); 534 ++iAttachmentTypeIndex; 535 #ifdef VBOX_WITH_VDE 536 RTLDRMOD hLdrDummy; 537 if (RT_SUCCESS(RTLdrLoad(VBOX_LIB_VDE_PLUG_NAME, &hLdrDummy))) 538 { 539 m_pAttachmentTypeCombo->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_VDE)); 540 m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_VDE); 541 m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeCombo->itemText(iAttachmentTypeIndex), Qt::ToolTipRole); 542 ++iAttachmentTypeIndex; 543 } 544 #endif 545 546 /* Restore the previously selected attachment type: */ 547 m_pAttachmentTypeCombo->setCurrentIndex(iCurrentAttachment); 548 } 549 550 /* Adapter type: */ 551 { 552 /* Remember the currently selected adapter type: */ 553 int iCurrentAdapter = m_pAdapterTypeCombo->currentIndex(); 554 555 /* Clear the adapter type combo-box: */ 556 m_pAdapterTypeCombo->clear(); 557 558 /* Populate adapter types: */ 559 int iAdapterTypeIndex = 0; 560 m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, vboxGlobal().toString(KNetworkAdapterType_Am79C970A)); 561 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_Am79C970A); 562 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole); 563 ++iAdapterTypeIndex; 564 m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, vboxGlobal().toString(KNetworkAdapterType_Am79C973)); 565 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_Am79C973); 566 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole); 567 ++iAdapterTypeIndex; 520 568 #ifdef VBOX_WITH_E1000 521 mCbAdapterType->insertItem (2, 522 vboxGlobal().toString (KNetworkAdapterType_I82540EM)); 523 mCbAdapterType->setItemData (2, 524 KNetworkAdapterType_I82540EM); 525 mCbAdapterType->setItemData (2, 526 mCbAdapterType->itemText (2), Qt::ToolTipRole); 527 mCbAdapterType->insertItem (3, 528 vboxGlobal().toString (KNetworkAdapterType_I82543GC)); 529 mCbAdapterType->setItemData (3, 530 KNetworkAdapterType_I82543GC); 531 mCbAdapterType->setItemData (3, 532 mCbAdapterType->itemText (3), Qt::ToolTipRole); 533 mCbAdapterType->insertItem (4, 534 vboxGlobal().toString (KNetworkAdapterType_I82545EM)); 535 mCbAdapterType->setItemData (4, 536 KNetworkAdapterType_I82545EM); 537 mCbAdapterType->setItemData (4, 538 mCbAdapterType->itemText (4), Qt::ToolTipRole); 569 m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, vboxGlobal().toString(KNetworkAdapterType_I82540EM)); 570 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_I82540EM); 571 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole); 572 ++iAdapterTypeIndex; 573 m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, vboxGlobal().toString(KNetworkAdapterType_I82543GC)); 574 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_I82543GC); 575 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole); 576 ++iAdapterTypeIndex; 577 m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, vboxGlobal().toString(KNetworkAdapterType_I82545EM)); 578 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_I82545EM); 579 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole); 580 ++iAdapterTypeIndex; 539 581 #endif /* VBOX_WITH_E1000 */ 540 582 #ifdef VBOX_WITH_VIRTIO 541 mCbAdapterType->insertItem (5, 542 vboxGlobal().toString (KNetworkAdapterType_Virtio)); 543 mCbAdapterType->setItemData (5, 544 KNetworkAdapterType_Virtio); 545 mCbAdapterType->setItemData (5, 546 mCbAdapterType->itemText (5), Qt::ToolTipRole); 583 m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, vboxGlobal().toString(KNetworkAdapterType_Virtio)); 584 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_Virtio); 585 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole); 586 ++iAdapterTypeIndex; 547 587 #endif /* VBOX_WITH_VIRTIO */ 548 588 549 /* Set the old value */ 550 mCbAdapterType->setCurrentIndex (currentAdapter == -1 ? 551 0 : currentAdapter); 552 553 554 /* Save the current selected attachment type */ 555 int currentAttachment = mCbAttachmentType->currentIndex(); 556 557 /* Clear the attachments combo-box */ 558 mCbAttachmentType->clear(); 559 560 /* Populate attachments */ 561 mCbAttachmentType->insertItem (0, 562 vboxGlobal().toString (KNetworkAttachmentType_Null)); 563 mCbAttachmentType->setItemData (0, 564 KNetworkAttachmentType_Null); 565 mCbAttachmentType->setItemData (0, 566 mCbAttachmentType->itemText (0), Qt::ToolTipRole); 567 mCbAttachmentType->insertItem (1, 568 vboxGlobal().toString (KNetworkAttachmentType_NAT)); 569 mCbAttachmentType->setItemData (1, 570 KNetworkAttachmentType_NAT); 571 mCbAttachmentType->setItemData (1, 572 mCbAttachmentType->itemText (1), Qt::ToolTipRole); 573 mCbAttachmentType->insertItem (2, 574 vboxGlobal().toString (KNetworkAttachmentType_Bridged)); 575 mCbAttachmentType->setItemData (2, 576 KNetworkAttachmentType_Bridged); 577 mCbAttachmentType->setItemData (2, 578 mCbAttachmentType->itemText (2), Qt::ToolTipRole); 579 mCbAttachmentType->insertItem (3, 580 vboxGlobal().toString (KNetworkAttachmentType_Internal)); 581 mCbAttachmentType->setItemData (3, 582 KNetworkAttachmentType_Internal); 583 mCbAttachmentType->setItemData (3, 584 mCbAttachmentType->itemText (3), Qt::ToolTipRole); 585 mCbAttachmentType->insertItem (4, 586 vboxGlobal().toString (KNetworkAttachmentType_HostOnly)); 587 mCbAttachmentType->setItemData (4, 588 KNetworkAttachmentType_HostOnly); 589 mCbAttachmentType->setItemData (4, 590 mCbAttachmentType->itemText (4), Qt::ToolTipRole); 591 #ifdef VBOX_WITH_VDE 592 RTLDRMOD hLdrDummy; 593 if (RT_SUCCESS(RTLdrLoad(VBOX_LIB_VDE_PLUG_NAME, &hLdrDummy))) 594 { 595 mCbAttachmentType->insertItem (5, 596 vboxGlobal().toString (KNetworkAttachmentType_VDE)); 597 mCbAttachmentType->setItemData (5, 598 KNetworkAttachmentType_VDE); 599 mCbAttachmentType->setItemData (5, 600 mCbAttachmentType->itemText (5), Qt::ToolTipRole); 601 } 602 #endif 603 604 /* Set the old value */ 605 mCbAttachmentType->setCurrentIndex (currentAttachment); 589 /* Restore the previously selected adapter type: */ 590 m_pAdapterTypeCombo->setCurrentIndex(iCurrentAdapter == -1 ? 0 : iCurrentAdapter); 591 } 592 593 /* Promiscuous Mode type: */ 594 { 595 /* Remember the currently selected promiscuous mode type: */ 596 int iCurrentPromiscuousMode = m_pPromiscuousModeCombo->currentIndex(); 597 598 /* Clear the promiscuous mode combo-box: */ 599 m_pPromiscuousModeCombo->clear(); 600 601 /* Populate promiscuous modes: */ 602 int iPromiscuousModeIndex = 0; 603 m_pPromiscuousModeCombo->insertItem(iPromiscuousModeIndex, vboxGlobal().toString(KNetworkAdapterPromiscModePolicy_Deny)); 604 m_pPromiscuousModeCombo->setItemData(iPromiscuousModeIndex, KNetworkAdapterPromiscModePolicy_Deny); 605 m_pPromiscuousModeCombo->setItemData(iPromiscuousModeIndex, m_pPromiscuousModeCombo->itemText(iPromiscuousModeIndex), Qt::ToolTipRole); 606 ++iPromiscuousModeIndex; 607 m_pPromiscuousModeCombo->insertItem(iPromiscuousModeIndex, vboxGlobal().toString(KNetworkAdapterPromiscModePolicy_AllowNetwork)); 608 m_pPromiscuousModeCombo->setItemData(iPromiscuousModeIndex, KNetworkAdapterPromiscModePolicy_AllowNetwork); 609 m_pPromiscuousModeCombo->setItemData(iPromiscuousModeIndex, m_pPromiscuousModeCombo->itemText(iPromiscuousModeIndex), Qt::ToolTipRole); 610 ++iPromiscuousModeIndex; 611 m_pPromiscuousModeCombo->insertItem(iPromiscuousModeIndex, vboxGlobal().toString(KNetworkAdapterPromiscModePolicy_AllowAll)); 612 m_pPromiscuousModeCombo->setItemData(iPromiscuousModeIndex, KNetworkAdapterPromiscModePolicy_AllowAll); 613 m_pPromiscuousModeCombo->setItemData(iPromiscuousModeIndex, m_pPromiscuousModeCombo->itemText(iPromiscuousModeIndex), Qt::ToolTipRole); 614 ++iPromiscuousModeIndex; 615 616 /* Restore the previously selected promiscuous mode type: */ 617 m_pPromiscuousModeCombo->setCurrentIndex(iCurrentPromiscuousMode); 618 } 606 619 } 607 620 608 621 /* UIMachineSettingsNetworkPage Stuff */ 609 UIMachineSettingsNetworkPage::UIMachineSettingsNetworkPage(bool aDisableStaticControls) 610 : mValidator(0) 611 , mTwAdapters(0) 612 , mDisableStaticControls(false) 613 { 614 /* Setup Main Layout */ 615 QVBoxLayout *mainLayout = new QVBoxLayout (this); 616 mainLayout->setContentsMargins (0, 5, 0, 5); 617 618 /* Creating Tab Widget */ 619 mTwAdapters = new QITabWidget (this); 620 mainLayout->addWidget (mTwAdapters); 621 622 /* If some controls should be disabled or not when the 623 * same tab widgets are shown during runtime 624 */ 625 mDisableStaticControls = aDisableStaticControls; 626 627 /* How many adapters to display */ 622 UIMachineSettingsNetworkPage::UIMachineSettingsNetworkPage(bool fDisableStaticControls) 623 : m_pValidator(0) 624 , m_pTwAdapters(0) 625 , m_fDisableStaticControls(fDisableStaticControls) 626 { 627 /* Setup main layout: */ 628 QVBoxLayout *pMainLayout = new QVBoxLayout(this); 629 pMainLayout->setContentsMargins(0, 5, 0, 5); 630 631 /* Creating tab-widget: */ 632 m_pTwAdapters = new QITabWidget(this); 633 pMainLayout->addWidget(m_pTwAdapters); 634 635 /* How many adapters to display: */ 628 636 ulong uCount = qMin((ULONG)4, vboxGlobal().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(KChipsetType_PIIX3)); 629 /* Add the tab pages to parent tab widget. Needed for space calculations .*/637 /* Add the tab pages to parent tab widget. Needed for space calculations: */ 630 638 for (ulong iSlot = 0; iSlot < uCount; ++iSlot) 631 639 { 632 640 /* Creating adapter's page: */ 633 UIMachineSettingsNetwork *pPage = new UIMachineSettingsNetwork(this, m DisableStaticControls);641 UIMachineSettingsNetwork *pPage = new UIMachineSettingsNetwork(this, m_fDisableStaticControls); 634 642 /* Attach adapter's page to Tab Widget: */ 635 m TwAdapters->addTab(pPage, pPage->pageTitle());643 m_pTwAdapters->addTab(pPage, pPage->pageTitle()); 636 644 } 637 645 } … … 655 663 } 656 664 657 QStringList UIMachineSettingsNetworkPage::brgList (bool aRefresh) 658 { 659 if (aRefresh) 660 { 661 /* Load & filter interface list */ 662 mBrgList.clear(); 663 CHostNetworkInterfaceVector interfaces = 664 vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces(); 665 QStringList UIMachineSettingsNetworkPage::brgList(bool fRefresh) 666 { 667 if (fRefresh) 668 { 669 /* Load & filter interface list: */ 670 m_brgList.clear(); 671 CHostNetworkInterfaceVector interfaces = vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces(); 665 672 for (CHostNetworkInterfaceVector::ConstIterator it = interfaces.begin(); 666 it != interfaces.end(); ++ 673 it != interfaces.end(); ++it) 667 674 { 668 675 if (it->GetInterfaceType() == KHostNetworkInterfaceType_Bridged) 669 m BrgList << it->GetName();670 } 671 } 672 673 return m BrgList;674 } 675 676 QStringList UIMachineSettingsNetworkPage::intList (bool aRefresh)677 { 678 if ( aRefresh)679 { 680 /* Load total network list of all VMs */681 m IntList.clear();676 m_brgList << it->GetName(); 677 } 678 } 679 680 return m_brgList; 681 } 682 683 QStringList UIMachineSettingsNetworkPage::intList(bool fRefresh) 684 { 685 if (fRefresh) 686 { 687 /* Load total network list of all VMs: */ 688 m_intList.clear(); 682 689 CVirtualBox vbox = vboxGlobal().virtualBox(); 683 690 ulong count = qMin ((ULONG) 4, vbox.GetSystemProperties().GetMaxNetworkAdapters(KChipsetType_PIIX3)); 684 691 CMachineVector vec = vbox.GetMachines(); 685 for (CMachineVector::ConstIterator m = vec.begin(); m != vec.end(); ++ 692 for (CMachineVector::ConstIterator m = vec.begin(); m != vec.end(); ++m) 686 693 { 687 694 if (m->GetAccessible()) 688 695 { 689 for (ulong slot = 0; slot < count; ++ 696 for (ulong slot = 0; slot < count; ++slot) 690 697 { 691 QString name = m->GetNetworkAdapter(slot).GetInternalNetwork();692 if (! name.isEmpty() && !mIntList.contains (name))693 m IntList << name;698 QString strName = m->GetNetworkAdapter(slot).GetInternalNetwork(); 699 if (!strName.isEmpty() && !m_intList.contains(strName)) 700 m_intList << strName; 694 701 } 695 702 } … … 697 704 } 698 705 699 return m IntList;700 } 701 702 QStringList UIMachineSettingsNetworkPage::fullIntList (bool aRefresh)703 { 704 QStringList list (intList (aRefresh));705 /* Append network list with names from all the pages */706 for (int index = 0; index < m TwAdapters->count(); ++index)707 { 708 UIMachineSettingsNetwork *p age =709 qobject_cast <UIMachineSettingsNetwork*> (mTwAdapters->widget(index));710 if (p age)711 { 712 QString name = page->alternativeName(KNetworkAttachmentType_Internal);713 if (! name.isEmpty() && !list.contains (name))714 list << name;706 return m_intList; 707 } 708 709 QStringList UIMachineSettingsNetworkPage::fullIntList(bool fRefresh) 710 { 711 QStringList list(intList(fRefresh)); 712 /* Append network list with names from all the pages: */ 713 for (int index = 0; index < m_pTwAdapters->count(); ++index) 714 { 715 UIMachineSettingsNetwork *pPage = 716 qobject_cast <UIMachineSettingsNetwork*>(m_pTwAdapters->widget(index)); 717 if (pPage) 718 { 719 QString strName = pPage->alternativeName(KNetworkAttachmentType_Internal); 720 if (!strName.isEmpty() && !list.contains(strName)) 721 list << strName; 715 722 } 716 723 } … … 718 725 } 719 726 720 QStringList UIMachineSettingsNetworkPage::hoiList (bool aRefresh) 721 { 722 if (aRefresh) 723 { 724 /* Load & filter interface list */ 725 mHoiList.clear(); 726 CHostNetworkInterfaceVector interfaces = 727 vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces(); 727 QStringList UIMachineSettingsNetworkPage::hoiList(bool fRefresh) 728 { 729 if (fRefresh) 730 { 731 /* Load & filter interface list: */ 732 m_hoiList.clear(); 733 CHostNetworkInterfaceVector interfaces = vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces(); 728 734 for (CHostNetworkInterfaceVector::ConstIterator it = interfaces.begin(); 729 it != interfaces.end(); ++ 735 it != interfaces.end(); ++it) 730 736 { 731 737 if (it->GetInterfaceType() == KHostNetworkInterfaceType_HostOnly) 732 m HoiList << it->GetName();733 } 734 } 735 736 return m HoiList;738 m_hoiList << it->GetName(); 739 } 740 } 741 742 return m_hoiList; 737 743 } 738 744 … … 763 769 data.m_adapter = adapter; 764 770 data.m_fAdapterEnabled = adapter.GetEnabled(); 765 data.m_adapterType = adapter.GetAdapterType();766 771 data.m_attachmentType = adapter.GetAttachmentType(); 767 772 switch (data.m_attachmentType) … … 790 795 791 796 /* Load advanced options: */ 797 data.m_adapterType = adapter.GetAdapterType(); 798 data.m_promiscuousMode = adapter.GetPromiscModePolicy(); 792 799 data.m_strMACAddress = adapter.GetMACAddress(); 793 800 data.m_fCableConnected = adapter.GetCableConnected(); … … 821 828 /* Setup tab order: */ 822 829 Assert(m_pFirstWidget); 823 setTabOrder(m_pFirstWidget, m TwAdapters->focusProxy());824 QWidget *pLastFocusWidget = m TwAdapters->focusProxy();825 826 int uCount = qMin(m TwAdapters->count(), m_cache.m_items.size());830 setTabOrder(m_pFirstWidget, m_pTwAdapters->focusProxy()); 831 QWidget *pLastFocusWidget = m_pTwAdapters->focusProxy(); 832 833 int uCount = qMin(m_pTwAdapters->count(), m_cache.m_items.size()); 827 834 for (int iSlot = 0; iSlot < uCount; ++iSlot) 828 835 { 829 UIMachineSettingsNetwork *pPage = 830 qobject_cast<UIMachineSettingsNetwork *>(mTwAdapters->widget(iSlot)); 836 UIMachineSettingsNetwork *pPage = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(iSlot)); 831 837 Assert(pPage); 832 838 … … 835 841 836 842 /* Disable tab page of disabled adapter if it is being configured dynamically: */ 837 if (m DisableStaticControls && !m_cache.m_items[iSlot].m_fAdapterEnabled)838 m TwAdapters->setTabEnabled(iSlot, false);843 if (m_fDisableStaticControls && !m_cache.m_items[iSlot].m_fAdapterEnabled) 844 m_pTwAdapters->setTabEnabled(iSlot, false); 839 845 840 846 /* Setup page validation: */ 841 pPage->setValidator(m Validator);847 pPage->setValidator(m_pValidator); 842 848 843 849 /* Setup tab order: */ … … 849 855 850 856 /* Revalidate if possible: */ 851 if (m Validator) mValidator->revalidate();857 if (m_pValidator) m_pValidator->revalidate(); 852 858 } 853 859 … … 860 866 { 861 867 /* Getting adapter's page: */ 862 UIMachineSettingsNetwork *pPage = qobject_cast<UIMachineSettingsNetwork*>(m TwAdapters->widget(iSlot));868 UIMachineSettingsNetwork *pPage = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(iSlot)); 863 869 864 870 /* Loading Adapter's data from page: */ … … 885 891 /* Save main options: */ 886 892 adapter.SetEnabled(data.m_fAdapterEnabled); 887 adapter.SetAdapterType(data.m_adapterType);888 893 switch (data.m_attachmentType) 889 894 { … … 917 922 918 923 /* Save advanced options: */ 924 adapter.SetAdapterType(data.m_adapterType); 925 adapter.SetPromiscModePolicy(data.m_promiscuousMode); 919 926 adapter.SetMACAddress(data.m_strMACAddress); 920 927 adapter.SetCableConnected(data.m_fCableConnected); … … 938 945 } 939 946 940 void UIMachineSettingsNetworkPage::setValidator (QIWidgetValidator *aVal)941 { 942 m Validator = aVal;943 } 944 945 bool UIMachineSettingsNetworkPage::revalidate (QString &aWarning, QString &aTitle)946 { 947 bool valid = true;948 949 for (int i = 0; i < m TwAdapters->count(); ++i)950 { 951 UIMachineSettingsNetwork *p age =952 qobject_cast <UIMachineSettingsNetwork*> (mTwAdapters->widget (i));953 Assert (page);954 valid = page->revalidate (aWarning, aTitle);955 if (!valid)break;956 } 957 958 return valid;947 void UIMachineSettingsNetworkPage::setValidator(QIWidgetValidator *pValidator) 948 { 949 m_pValidator = pValidator; 950 } 951 952 bool UIMachineSettingsNetworkPage::revalidate(QString &strWarning, QString &strTitle) 953 { 954 bool fValid = true; 955 956 for (int i = 0; i < m_pTwAdapters->count(); ++i) 957 { 958 UIMachineSettingsNetwork *pPage = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(i)); 959 Assert(pPage); 960 fValid = pPage->revalidate(strWarning, strTitle); 961 if (!fValid) 962 break; 963 } 964 965 return fValid; 959 966 } 960 967 961 968 void UIMachineSettingsNetworkPage::retranslateUi() 962 969 { 963 for (int i = 0; i < mTwAdapters->count(); ++ i) 964 { 965 UIMachineSettingsNetwork *page = 966 qobject_cast <UIMachineSettingsNetwork*> (mTwAdapters->widget (i)); 967 Assert (page); 968 mTwAdapters->setTabText (i, page->pageTitle()); 970 for (int i = 0; i < m_pTwAdapters->count(); ++ i) 971 { 972 UIMachineSettingsNetwork *pPage = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(i)); 973 Assert(pPage); 974 m_pTwAdapters->setTabText(i, pPage->pageTitle()); 969 975 } 970 976 } … … 972 978 void UIMachineSettingsNetworkPage::updatePages() 973 979 { 974 for (int i = 0; i < mTwAdapters->count(); ++ i) 975 { 976 /* Get the iterated page */ 977 UIMachineSettingsNetwork *page = 978 qobject_cast <UIMachineSettingsNetwork*> (mTwAdapters->widget (i)); 979 Assert (page); 980 for (int i = 0; i < m_pTwAdapters->count(); ++ i) 981 { 982 /* Get the iterated page: */ 983 UIMachineSettingsNetwork *pPage = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(i)); 984 Assert(pPage); 980 985 981 986 /* Update the page if the attachment type is 'internal network' */ 982 if (p age->attachmentType() == KNetworkAttachmentType_Internal)983 QTimer::singleShot (0, page, SLOT (updateAttachmentAlternative()));984 } 985 } 987 if (pPage->attachmentType() == KNetworkAttachmentType_Internal) 988 QTimer::singleShot(0, pPage, SLOT(sltUpdateAttachmentAlternative())); 989 } 990 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.h
r33882 r36104 6 6 7 7 /* 8 * Copyright (C) 2008-201 0Oracle Corporation8 * Copyright (C) 2008-2011 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 20 20 #define __UIMachineSettingsNetwork_h__ 21 21 22 /* VBox Includes */22 /* Local includes */ 23 23 #include "COMDefs.h" 24 24 #include "UISettingsPage.h" … … 26 26 #include "UIMachineSettingsPortForwardingDlg.h" 27 27 28 /* VBox Forwards */28 /* Forward declarations */ 29 29 class UIMachineSettingsNetworkPage; 30 30 class QITabWidget; … … 39 39 KNetworkAdapterType m_adapterType; 40 40 KNetworkAttachmentType m_attachmentType; 41 KNetworkAdapterPromiscModePolicy m_promiscuousMode; 41 42 QString m_strBridgedAdapterName; 42 43 QString m_strInternalNetworkName; … … 56 57 }; 57 58 58 class UIMachineSettingsNetwork : public QIWithRetranslateUI <QWidget>, 59 public Ui::UIMachineSettingsNetwork 59 /* Machine settings / Network page / Adapter tab: */ 60 class UIMachineSettingsNetwork : public QIWithRetranslateUI<QWidget>, 61 public Ui::UIMachineSettingsNetwork 60 62 { 61 63 Q_OBJECT; … … 63 65 public: 64 66 65 UIMachineSettingsNetwork (UIMachineSettingsNetworkPage *aParent, bool aDisableStaticControls = false);67 UIMachineSettingsNetwork(UIMachineSettingsNetworkPage *pParent, bool fDisableStaticControls = false); 66 68 67 69 void fetchAdapterData(const UINetworkAdapterData &data); 68 70 void uploadAdapterData(UINetworkAdapterData &data); 69 71 70 void setValidator (QIWidgetValidator *aValidator);71 bool revalidate (QString &aWarning, QString &aTitle);72 void setValidator(QIWidgetValidator *pValidator); 73 bool revalidate(QString &strWarning, QString &strTitle); 72 74 73 QWidget* setOrderAfter (QWidget *aAfter);75 QWidget* setOrderAfter(QWidget *pAfter); 74 76 75 77 QString pageTitle() const; 78 76 79 KNetworkAttachmentType attachmentType() const; 77 QString alternativeName (int aType = -1) const;80 QString alternativeName(int type = -1) const; 78 81 79 82 protected: 80 83 81 void showEvent (QShowEvent *aEvent);84 void showEvent(QShowEvent *pEvent); 82 85 83 86 void retranslateUi(); … … 85 88 private slots: 86 89 87 void updateAttachmentAlternative();88 void updateAlternativeName();89 void toggleAdvanced();90 void generateMac();90 void sltUpdateAttachmentAlternative(); 91 void sltUpdateAlternativeName(); 92 void sltToggleAdvanced(); 93 void sltGenerateMac(); 91 94 void sltOpenPortForwardingDlg(); 92 95 … … 95 98 void populateComboboxes(); 96 99 97 UIMachineSettingsNetworkPage *m Parent;98 QIWidgetValidator *m Validator;100 UIMachineSettingsNetworkPage *m_pParent; 101 QIWidgetValidator *m_pValidator; 99 102 int m_iSlot; 100 103 CNetworkAdapter m_adapter; 101 104 102 QString m BrgName;103 QString m IntName;104 QString m HoiName;105 QString m_strBrgName; 106 QString m_strIntName; 107 QString m_strHoiName; 105 108 #ifdef VBOX_WITH_VDE 106 109 QString mVDEName; 107 #endif 110 #endif /* VBOX_WITH_VDE */ 108 111 109 bool m Polished;110 bool m DisableStaticControls;111 UIPortForwardingDataList m PortForwardingRules;112 bool m_fPolished; 113 bool m_fDisableStaticControls; 114 UIPortForwardingDataList m_portForwardingRules; 112 115 }; 113 116 … … 119 122 public: 120 123 121 UIMachineSettingsNetworkPage (bool aDisableStaticControls = false);124 UIMachineSettingsNetworkPage(bool fDisableStaticControls = false); 122 125 123 126 void loadDirectlyFrom(const CMachine &machine); 124 127 void saveDirectlyTo(CMachine &machine); 125 128 126 QStringList brgList 127 QStringList intList 128 QStringList fullIntList 129 QStringList hoiList 129 QStringList brgList(bool aRefresh = false); 130 QStringList intList(bool aRefresh = false); 131 QStringList fullIntList(bool aRefresh = false); 132 QStringList hoiList(bool aRefresh = false); 130 133 131 134 protected: … … 145 148 void saveFromCacheTo(QVariant &data); 146 149 147 void setValidator (QIWidgetValidator *aValidator);148 bool revalidate (QString &aWarning, QString &aTitle);150 void setValidator(QIWidgetValidator *pValidator); 151 bool revalidate(QString &strWarning, QString &strTitle); 149 152 150 153 void retranslateUi(); … … 156 159 private: 157 160 158 QIWidgetValidator *m Validator;159 QITabWidget *m TwAdapters;161 QIWidgetValidator *m_pValidator; 162 QITabWidget *m_pTwAdapters; 160 163 161 QStringList m BrgList;162 QStringList m IntList;163 QStringList m HoiList;164 QStringList m_brgList; 165 QStringList m_intList; 166 QStringList m_hoiList; 164 167 165 bool m DisableStaticControls;168 bool m_fDisableStaticControls; 166 169 167 170 /* Cache: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.ui
r33882 r36104 1 <ui version="4.0" 1 <ui version="4.0"> 2 2 <comment> 3 3 VBox frontends: Qt4 GUI ("VirtualBox"): 4 4 5 Copyright (C) 2008 Oracle Corporation5 Copyright (C) 2008-2011 Oracle Corporation 6 6 7 7 This file is part of VirtualBox Open Source Edition (OSE), as … … 14 14 </comment> 15 15 <class>UIMachineSettingsNetwork</class> 16 <widget class="QWidget" name="UIMachineSettingsNetwork" 17 <property name="geometry" 16 <widget class="QWidget" name="UIMachineSettingsNetwork"> 17 <property name="geometry"> 18 18 <rect> 19 19 <x>0</x> … … 25 25 <layout class="QGridLayout" name="VBoxVMSettingsNetworkGridLayout"> 26 26 <item row="0" column="0" colspan="2"> 27 <widget class="QCheckBox" name="mCbEnableAdapter" 28 <property name="whatsThis" 27 <widget class="QCheckBox" name="mCbEnableAdapter"> 28 <property name="whatsThis"> 29 29 <string>When checked, plugs this virtual network adapter into the virtual machine.</string> 30 30 </property> 31 <property name="text" 31 <property name="text"> 32 32 <string>&Enable Network Adapter</string> 33 33 </property> 34 <property name="checked" 34 <property name="checked"> 35 35 <bool>true</bool> 36 36 </property> … … 38 38 </item> 39 39 <item row="1" column="0"> 40 <spacer name=" horizontalSpacer1">40 <spacer name="m_pHorizontalSpacer1"> 41 41 <property name="orientation"> 42 42 <enum>Qt::Horizontal</enum> … … 53 53 </spacer> 54 54 </item> 55 <item row="1" column="1" 56 <widget class="QWidget" name="m NetworkChild" native="1">57 <layout class="QGridLayout" name="m NetworkChildGridLayout">55 <item row="1" column="1"> 56 <widget class="QWidget" name="m_pNetworkChild" native="1"> 57 <layout class="QGridLayout" name="m_pNetworkChildGridLayout"> 58 58 <property name="margin"> 59 59 <number>0</number> 60 60 </property> 61 <item row="0" column="0" 62 <widget class="QLabel" name="m LbAttachmentType">63 <property name="text" 61 <item row="0" column="0"> 62 <widget class="QLabel" name="m_pAttachmentTypeLabel"> 63 <property name="text"> 64 64 <string>&Attached to:</string> 65 65 </property> 66 <property name="alignment" 67 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 68 </property> 69 <property name="buddy" 70 <cstring>m CbAttachmentType</cstring>66 <property name="alignment"> 67 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 68 </property> 69 <property name="buddy"> 70 <cstring>m_pAttachmentTypeCombo</cstring> 71 71 </property> 72 72 </widget> 73 73 </item> 74 74 <item row="0" column="1"> 75 <widget class="QComboBox" name="m CbAttachmentType">75 <widget class="QComboBox" name="m_pAttachmentTypeCombo"> 76 76 <property name="sizePolicy"> 77 77 <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> … … 80 80 </sizepolicy> 81 81 </property> 82 <property name="whatsThis" 82 <property name="whatsThis"> 83 83 <string>Controls how this virtual adapter is attached to the real network of the Host OS.</string> 84 84 </property> 85 85 </widget> 86 86 </item> 87 <item row="1" column="0" 88 <widget class="QLabel" name="m LbAdapterName">89 <property name="text" 87 <item row="1" column="0"> 88 <widget class="QLabel" name="m_pAdapterNameLabel"> 89 <property name="text"> 90 90 <string>&Name:</string> 91 91 </property> 92 <property name="alignment" 93 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 94 </property> 95 <property name="buddy" 96 <cstring>m CbAdapterName</cstring>92 <property name="alignment"> 93 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 94 </property> 95 <property name="buddy"> 96 <cstring>m_pAdapterNameCombo</cstring> 97 97 </property> 98 98 </widget> 99 99 </item> 100 100 <item row="1" column="1" colspan="3"> 101 <widget class="QComboBox" name="m CbAdapterName">101 <widget class="QComboBox" name="m_pAdapterNameCombo"> 102 102 <property name="sizePolicy"> 103 103 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> … … 106 106 </sizepolicy> 107 107 </property> 108 <property name="whatsThis" 108 <property name="whatsThis"> 109 109 <string>Selects the name of the network adapter for <b>Bridged Adapter</b> or <b>Host-only Adapter</b> attachments and the name of the network <b>Internal Network</b> attachments.</string> 110 110 </property> … … 112 112 </item> 113 113 <item row="2" column="0"> 114 <layout class="QHBoxLayout" name="m LtAdvancedBtn">114 <layout class="QHBoxLayout" name="m_pAdvancedButtonLayout"> 115 115 <property name="margin"> 116 116 <number>0</number> 117 117 </property> 118 118 <item> 119 <spacer name=" horizontalSpacer2">119 <spacer name="m_pHorizontalSpacer2"> 120 120 <property name="orientation"> 121 121 <enum>Qt::Horizontal</enum> … … 130 130 </item> 131 131 <item> 132 <widget class="QIArrowButtonSwitch" native="1" name="m AbsAdvanced">132 <widget class="QIArrowButtonSwitch" native="1" name="m_pAdvancedArrow"> 133 133 <property name="text"> 134 134 <string>A&dvanced</string> 135 135 </property> 136 <property name="whatsThis" 136 <property name="whatsThis"> 137 137 <string>Shows or hides additional network adapter options.</string> 138 138 </property> … … 142 142 </item> 143 143 <item row="3" column="0"> 144 <widget class="QLabel" name="m LbAdapterType">144 <widget class="QLabel" name="m_pAdapterTypeLabel"> 145 145 <property name="text"> 146 146 <string>Adapter &Type:</string> … … 150 150 </property> 151 151 <property name="buddy"> 152 <cstring>m CbAdapterType</cstring>152 <cstring>m_pAdapterTypeCombo</cstring> 153 153 </property> 154 154 </widget> 155 155 </item> 156 156 <item row="3" column="1" colspan="3"> 157 <widget class="QComboBox" name="m CbAdapterType">157 <widget class="QComboBox" name="m_pAdapterTypeCombo"> 158 158 <property name="sizePolicy"> 159 159 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> … … 168 168 </item> 169 169 <item row="4" column="0"> 170 <widget class="QLabel" name="m LbMAC">171 <property name="text"> 172 <string>& Mac Address:</string>173 </property> 174 <property name="alignment" 175 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 176 </property> 177 <property name="buddy"> 178 <cstring>m LeMAC</cstring>179 </property> 180 </widget> 181 </item> 182 <item row="4" column="1" colspan=" 2">183 <widget class="Q ILineEdit" name="mLeMAC">170 <widget class="QLabel" name="m_pPromiscuousModeLabel"> 171 <property name="text"> 172 <string>&Promiscuous Mode:</string> 173 </property> 174 <property name="alignment"> 175 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 176 </property> 177 <property name="buddy"> 178 <cstring>m_pPromiscuousModeCombo</cstring> 179 </property> 180 </widget> 181 </item> 182 <item row="4" column="1" colspan="3"> 183 <widget class="QComboBox" name="m_pPromiscuousModeCombo"> 184 184 <property name="sizePolicy"> 185 185 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> … … 189 189 </property> 190 190 <property name="whatsThis"> 191 <string>Selects the promiscuous mode policy of the network adapter when attached to an internal network, host only network or a bridge.</string> 192 </property> 193 </widget> 194 </item> 195 <item row="5" column="0"> 196 <widget class="QLabel" name="m_pMACLabel"> 197 <property name="text"> 198 <string>&Mac Address:</string> 199 </property> 200 <property name="alignment"> 201 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 202 </property> 203 <property name="buddy"> 204 <cstring>m_pMACEditor</cstring> 205 </property> 206 </widget> 207 </item> 208 <item row="5" column="1" colspan="2"> 209 <widget class="QILineEdit" name="m_pMACEditor"> 210 <property name="sizePolicy"> 211 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> 212 <horstretch>1</horstretch> 213 <verstretch>0</verstretch> 214 </sizepolicy> 215 </property> 216 <property name="whatsThis"> 191 217 <string>Displays the MAC address of this adapter. It contains exactly 12 characters chosen from {0-9,A-F}. Note that the second character must be an even digit.</string> 192 218 </property> 193 219 </widget> 194 220 </item> 195 <item row=" 4" column="3">196 <widget class="QIToolButton" name="m TbMAC">221 <item row="5" column="3"> 222 <widget class="QIToolButton" name="m_pMACButton"> 197 223 <property name="whatsThis"> 198 224 <string>Generates a new random MAC address.</string> … … 207 233 </widget> 208 234 </item> 209 <item row=" 5" column="1" colspan="3">210 <widget class="QCheckBox" name="m CbCableConnected">235 <item row="6" column="1" colspan="3"> 236 <widget class="QCheckBox" name="m_pCableConnectedCheckBox"> 211 237 <property name="whatsThis"> 212 238 <string>Indicates whether the virtual network cable is plugged in on machine startup or not.</string> … … 217 243 </widget> 218 244 </item> 219 <item row=" 6" column="1">220 <widget class="QPushButton" name="m PbPortForwarding">245 <item row="7" column="1"> 246 <widget class="QPushButton" name="m_pPortForwardingButton"> 221 247 <property name="whatsThis"> 222 248 <string>Opens dialog to manage port forwarding rules.</string> … … 227 253 </widget> 228 254 </item> 229 <item row=" 7" column="0" colspan="4">230 <spacer name=" verticalSpacer">255 <item row="8" column="0" colspan="4"> 256 <spacer name="m_pVerticalSpacer"> 231 257 <property name="orientation"> 232 258 <enum>Qt::Vertical</enum> … … 270 296 <sender>mCbEnableAdapter</sender> 271 297 <signal>toggled(bool)</signal> 272 <receiver>m NetworkChild</receiver>298 <receiver>m_pNetworkChild</receiver> 273 299 <slot>setEnabled(bool)</slot> 274 300 <hints>
Note:
See TracChangeset
for help on using the changeset viewer.