Changeset 92762 in vbox
- Timestamp:
- Dec 6, 2021 12:22:53 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/networkmanager
- Files:
-
- 3 edited
-
UIDetailsWidgetCloudNetwork.cpp (modified) (6 diffs)
-
UIDetailsWidgetCloudNetwork.h (modified) (5 diffs)
-
UINetworkManager.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetCloudNetwork.cpp
r92731 r92762 49 49 , m_pLabelProfileName(0) 50 50 , m_pComboProfileName(0) 51 , m_pLabelNetworkId(0) 52 , m_pEditorNetworkId(0) 51 53 , m_pButtonBoxOptions(0) 52 54 { … … 126 128 if (m_pComboProfileName) 127 129 m_pComboProfileName->setToolTip(tr("Holds the cloud profile for this network.")); 130 if (m_pLabelNetworkId) 131 m_pLabelNetworkId->setText(tr("&Id:")); 132 if (m_pEditorNetworkId) 133 m_pEditorNetworkId->setToolTip(tr("Holds the id for this network.")); 128 134 if (m_pButtonBoxOptions) 129 135 { … … 170 176 } 171 177 178 void UIDetailsWidgetCloudNetwork::sltNetworkIdChanged(const QString &strText) 179 { 180 m_newData.m_strId = strText; 181 updateButtonStates(); 182 } 183 172 184 void UIDetailsWidgetCloudNetwork::sltHandleButtonBoxClick(QAbstractButton *pButton) 173 185 { … … 272 284 273 285 pLayoutOptions->addWidget(m_pComboProfileName, 2, 1); 286 } 287 288 /* Prepare network id label: */ 289 m_pLabelNetworkId = new QLabel(this); 290 if (m_pLabelNetworkId) 291 { 292 m_pLabelNetworkId->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 293 pLayoutOptions->addWidget(m_pLabelNetworkId, 3, 0); 294 } 295 /* Prepare network id editor: */ 296 m_pEditorNetworkId = new QLineEdit(this); 297 if (m_pEditorNetworkId) 298 { 299 if (m_pLabelNetworkId) 300 m_pLabelNetworkId->setBuddy(m_pEditorNetworkId); 301 connect(m_pEditorNetworkId, &QLineEdit::textEdited, 302 this, &UIDetailsWidgetCloudNetwork::sltNetworkIdChanged); 303 304 pLayoutOptions->addWidget(m_pEditorNetworkId, 3, 1); 274 305 } 275 306 … … 416 447 m_pLabelProfileName->setEnabled(fIsNetworkExists); 417 448 m_pComboProfileName->setEnabled(fIsNetworkExists); 449 m_pLabelNetworkId->setEnabled(fIsNetworkExists); 450 m_pEditorNetworkId->setEnabled(fIsNetworkExists); 418 451 419 452 /* Load fields: */ … … 423 456 const int iProfileIndex = m_pComboProfileName->findData(m_newData.m_strProfile); 424 457 m_pComboProfileName->setCurrentIndex(iProfileIndex == -1 ? 0 : iProfileIndex); 425 } 458 m_pEditorNetworkId->setText(m_newData.m_strId); 459 } -
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetCloudNetwork.h
r92731 r92762 54 54 , m_strProvider(QString()) 55 55 , m_strProfile(QString()) 56 , m_strId(QString()) 56 57 {} 57 58 … … 65 66 && (m_strProvider == other.m_strProvider) 66 67 && (m_strProfile == other.m_strProfile) 68 && (m_strId == other.m_strId) 67 69 ; 68 70 } … … 83 85 /** Holds cloud profile name. */ 84 86 QString m_strProfile; 87 /** Holds network id. */ 88 QString m_strId; 85 89 }; 86 90 … … 139 143 /** Handles cloud profile name index change. */ 140 144 void sltCloudProfileNameChanged(int iIndex); 145 /** Handles network id text change. */ 146 void sltNetworkIdChanged(const QString &strText); 141 147 142 148 /** Handles button-box button click. */ … … 189 195 /** Holds the cloud profile name combo instance. */ 190 196 QIComboBox *m_pComboProfileName; 197 /** Holds the network id label instance. */ 198 QLabel *m_pLabelNetworkId; 199 /** Holds the network id editor instance. */ 200 QLineEdit *m_pEditorNetworkId; 191 201 192 202 /** Holds the 'Options' button-box instance. */ -
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.cpp
r92731 r92762 783 783 oldData.m_strProvider = QString(); 784 784 oldData.m_strProfile = QString(); 785 oldData.m_strId = QString(); 785 786 786 787 /* Get VirtualBox for further activities: */ … … 808 809 if (comNetwork.isOk()) 809 810 comNetwork.SetProfile(oldData.m_strProfile); 811 /* Save cloud network id: */ 812 if (comNetwork.isOk()) 813 comNetwork.SetNetworkId(oldData.m_strId); 810 814 811 815 /* Show error message if necessary: */ … … 1472 1476 if (comNetwork.isOk() && newData.m_strProfile != oldData.m_strProfile) 1473 1477 comNetwork.SetProfile(newData.m_strProfile); 1478 /* Save cloud network id: */ 1479 if (comNetwork.isOk() && newData.m_strId != oldData.m_strId) 1480 comNetwork.SetNetworkId(newData.m_strId); 1474 1481 1475 1482 /* Show error message if necessary: */ … … 2068 2075 if (comNetwork.isOk()) 2069 2076 data.m_strProfile = comNetwork.GetProfile(); 2077 if (comNetwork.isOk()) 2078 data.m_strId = comNetwork.GetNetworkId(); 2070 2079 2071 2080 /* Show error message if necessary: */
Note:
See TracChangeset
for help on using the changeset viewer.

