Changeset 48538 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Sep 19, 2013 3:17:43 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendCOM.cpp
r48537 r48538 7 7 8 8 /* 9 * Copyright (C) 2012 Oracle Corporation9 * Copyright (C) 2012-2013 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 290 290 case KNetworkAttachmentType_HostOnly: return QApplication::translate("VBoxGlobal", "Host-only Adapter", "NetworkAttachmentType"); 291 291 case KNetworkAttachmentType_Generic: return QApplication::translate("VBoxGlobal", "Generic Driver", "NetworkAttachmentType"); 292 case KNetworkAttachmentType_NATNetwork: return QApplication::translate("VBoxGlobal", "NAT Network", "NetworkAttachmentType"); 292 293 default: AssertMsgFailed(("No text for %d", type)); break; 293 294 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r48534 r48538 1397 1397 attType = attType.arg (tr ("Generic, '%1'", 1398 1398 "details report (network)").arg (adapter.GetGenericDriver())); 1399 else if (type == KNetworkAttachmentType_NATNetwork) 1400 attType = attType.arg (tr ("NAT network, '%1'", 1401 "details report (network)").arg (adapter.GetNATNetwork())); 1399 1402 else 1400 1403 attType = attType.arg (gpConverter->toString (type)); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.cpp
r48314 r48538 677 677 break; 678 678 } 679 case KNetworkAttachmentType_NATNetwork: 680 { 681 strAttachmentType = strAttachmentType.arg(QApplication::translate("UIGDetails", "NAT Network, '%1'", "details (network)") 682 .arg(adapter.GetNATNetwork())); 683 break; 684 } 679 685 default: 680 686 { -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp
r47944 r48538 7 7 8 8 /* 9 * Copyright (C) 2008-201 2Oracle Corporation9 * Copyright (C) 2008-2013 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 30 30 #include "CNATEngine.h" 31 31 #include "CHostNetworkInterface.h" 32 #include "CNATNetwork.h" 32 33 33 34 /* Other VBox includes: */ … … 142 143 adapterData.m_strGenericProperties = m_pGenericPropertiesTextEdit->toPlainText(); 143 144 break; 145 case KNetworkAttachmentType_NATNetwork: 146 adapterData.m_strNATNetworkName = alternativeName(); 147 break; 144 148 default: 145 149 break; … … 211 215 { 212 216 message.second << tr("No generic driver is currently selected."); 217 fPass = false; 218 } 219 break; 220 } 221 case KNetworkAttachmentType_NATNetwork: 222 { 223 if (alternativeName().isNull()) 224 { 225 message.second << tr("No NAT network name is currently specified."); 213 226 fPass = false; 214 227 } … … 289 302 case KNetworkAttachmentType_Generic: 290 303 strResult = m_strGenericDriverName; 304 break; 305 case KNetworkAttachmentType_NATNetwork: 306 strResult = m_strNATNetworkName; 291 307 break; 292 308 default: … … 420 436 break; 421 437 } 438 case KNetworkAttachmentType_NATNetwork: 439 { 440 m_pAdapterNameCombo->setWhatsThis(tr("Enter the name of the NAT network that this network card " 441 "will be connected to. You can create and remove adapters " 442 "using the global network settings in the virtual machine " 443 "manager window.")); 444 m_pAdapterNameCombo->setEditable(true); 445 break; 446 } 422 447 default: 423 448 { … … 480 505 emit sigTabUpdated(); 481 506 } 507 break; 508 } 509 case KNetworkAttachmentType_NATNetwork: 510 { 511 QString newName(m_pAdapterNameCombo->itemData(m_pAdapterNameCombo->currentIndex()).toString() == QString(pEmptyItemCode) || 512 m_pAdapterNameCombo->currentText().isEmpty() ? QString() : m_pAdapterNameCombo->currentText()); 513 if (m_strNATNetworkName != newName) 514 m_strNATNetworkName = newName; 482 515 break; 483 516 } … … 560 593 m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, gpConverter->toString(KNetworkAttachmentType_Generic)); 561 594 m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Generic); 595 m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole); 596 ++iAttachmentTypeIndex; 597 m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, gpConverter->toString(KNetworkAttachmentType_NATNetwork)); 598 m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_NATNetwork); 562 599 m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole); 563 600 ++iAttachmentTypeIndex; … … 659 696 m_pAdapterNameCombo->insertItems(0, m_pParent->genericDriverList()); 660 697 break; 698 case KNetworkAttachmentType_NATNetwork: 699 m_pAdapterNameCombo->insertItems(0, m_pParent->natNetworkList()); 700 break; 661 701 default: 662 702 break; … … 670 710 case KNetworkAttachmentType_Bridged: 671 711 case KNetworkAttachmentType_HostOnly: 712 case KNetworkAttachmentType_NATNetwork: 672 713 { 673 714 /* If adapter list is empty => add 'Not selected' item: */ … … 706 747 case KNetworkAttachmentType_HostOnly: 707 748 case KNetworkAttachmentType_Generic: 749 case KNetworkAttachmentType_NATNetwork: 708 750 { 709 751 m_pAdapterNameCombo->setCurrentIndex(position(m_pAdapterNameCombo, alternativeName())); … … 770 812 refreshHostInterfaceList(); 771 813 refreshGenericDriverList(true); 814 refreshNATNetworkList(); 772 815 773 816 /* For each network adapter: */ … … 917 960 updateGenericProperties(adapter, adapterData.m_strGenericProperties); 918 961 break; 962 case KNetworkAttachmentType_NATNetwork: 963 adapter.SetNATNetwork(adapterData.m_strNATNetworkName); 964 break; 919 965 default: 920 966 break; … … 1091 1137 } 1092 1138 1139 void UIMachineSettingsNetworkPage::refreshNATNetworkList() 1140 { 1141 /* Reload NAT network list: */ 1142 m_natNetworkList.clear(); 1143 const CNATNetworkVector &nws = vboxGlobal().virtualBox().GetNATNetworks(); 1144 for (int i = 0; i < nws.size(); ++i) 1145 { 1146 const CNATNetwork &nw = nws[i]; 1147 m_natNetworkList << nw.GetNetworkName(); 1148 } 1149 } 1150 1093 1151 /* static */ 1094 1152 QStringList UIMachineSettingsNetworkPage::otherInternalNetworkList() -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.h
r47944 r48538 6 6 7 7 /* 8 * Copyright (C) 2008-201 2Oracle Corporation8 * Copyright (C) 2008-2013 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 44 44 , m_strGenericDriverName(QString()) 45 45 , m_strGenericProperties(QString()) 46 , m_strNATNetworkName(QString()) 46 47 , m_strMACAddress(QString()) 47 48 , m_fCableConnected(false) … … 60 61 (m_strGenericDriverName == other.m_strGenericDriverName) && 61 62 (m_strGenericProperties == other.m_strGenericProperties) && 63 (m_strNATNetworkName == other.m_strNATNetworkName) && 62 64 (m_strMACAddress == other.m_strMACAddress) && 63 65 (m_fCableConnected == other.m_fCableConnected) && … … 78 80 QString m_strGenericDriverName; 79 81 QString m_strGenericProperties; 82 QString m_strNATNetworkName; 80 83 QString m_strMACAddress; 81 84 bool m_fCableConnected; … … 165 168 QString m_strHostInterfaceName; 166 169 QString m_strGenericDriverName; 170 QString m_strNATNetworkName; 167 171 UIPortForwardingDataList m_portForwardingRules; 168 172 }; … … 186 190 /* Generic driver list: */ 187 191 const QStringList& genericDriverList() const { return m_genericDriverList; } 192 /* NAT network list: */ 193 const QStringList& natNetworkList() const { return m_natNetworkList; } 188 194 189 195 protected: … … 225 231 void refreshHostInterfaceList(); 226 232 void refreshGenericDriverList(bool fFullRefresh = false); 233 void refreshNATNetworkList(); 227 234 228 235 /* Various static stuff: */ … … 240 247 QStringList m_hostInterfaceList; 241 248 QStringList m_genericDriverList; 249 QStringList m_natNetworkList; 242 250 243 251 /* Cache: */
Note:
See TracChangeset
for help on using the changeset viewer.