Changeset 87306 in vbox
- Timestamp:
- Jan 19, 2021 4:00:46 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r87276 r87306 1866 1866 } 1867 1867 1868 void UIMessageCenter::warnAboutDHCPServerIsNotEnabled(const QString &strName, QWidget *pParent /* = 0 */) const 1869 { 1870 alert(pParent, MessageType_Error, 1871 tr("Host interface <nobr><b>%1</b></nobr> is set to obtain the address " 1872 "automatically but the corresponding DHCP server is not enabled.").arg(strName)); 1873 } 1874 1875 void UIMessageCenter::warnAboutInvalidIPv4Address(const QString &strName, QWidget *pParent /* = 0 */) const 1876 { 1877 alert(pParent, MessageType_Error, 1878 tr("Host interface <nobr><b>%1</b></nobr> does not " 1879 "currently have a valid IPv4 address.").arg(strName)); 1880 } 1881 1882 void UIMessageCenter::warnAboutInvalidIPv4Mask(const QString &strName, QWidget *pParent /* = 0 */) const 1883 { 1884 alert(pParent, MessageType_Error, 1885 tr("Host interface <nobr><b>%1</b></nobr> does not " 1886 "currently have a valid IPv4 network mask.").arg(strName)); 1887 } 1888 1889 void UIMessageCenter::warnAboutInvalidIPv6Address(const QString &strName, QWidget *pParent /* = 0 */) const 1890 { 1891 alert(pParent, MessageType_Error, 1892 tr("Host interface <nobr><b>%1</b></nobr> does not " 1893 "currently have a valid IPv6 address.").arg(strName)); 1894 } 1895 1896 void UIMessageCenter::warnAboutInvalidIPv6PrefixLength(const QString &strName, QWidget *pParent /* = 0 */) const 1897 { 1898 alert(pParent, MessageType_Error, 1899 tr("Host interface <nobr><b>%1</b></nobr> does not " 1900 "currently have a valid IPv6 prefix length.").arg(strName)); 1901 } 1902 1903 void UIMessageCenter::warnAboutInvalidDHCPServerAddress(const QString &strName, QWidget *pParent /* = 0 */) const 1904 { 1905 alert(pParent, MessageType_Error, 1906 tr("Host interface <nobr><b>%1</b></nobr> does not " 1907 "currently have a valid DHCP server address.").arg(strName)); 1908 } 1909 1910 void UIMessageCenter::warnAboutInvalidDHCPServerMask(const QString &strName, QWidget *pParent /* = 0 */) const 1911 { 1912 alert(pParent, MessageType_Error, 1913 tr("Host interface <nobr><b>%1</b></nobr> does not " 1914 "currently have a valid DHCP server mask.").arg(strName)); 1915 } 1916 1917 void UIMessageCenter::warnAboutInvalidDHCPServerLowerAddress(const QString &strName, QWidget *pParent /* = 0 */) const 1918 { 1919 alert(pParent, MessageType_Error, 1920 tr("Host interface <nobr><b>%1</b></nobr> does not " 1921 "currently have a valid DHCP server lower address bound.").arg(strName)); 1922 } 1923 1924 void UIMessageCenter::warnAboutInvalidDHCPServerUpperAddress(const QString &strName, QWidget *pParent /* = 0 */) const 1925 { 1926 alert(pParent, MessageType_Error, 1927 tr("Host interface <nobr><b>%1</b></nobr> does not " 1928 "currently have a valid DHCP server upper address bound.").arg(strName)); 1929 } 1930 1868 1931 void UIMessageCenter::cannotAcquireNATNetworks(const CVirtualBox &comVBox, QWidget *pParent /* = 0 */) const 1869 1932 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r87276 r87306 394 394 void cannotAcquireDHCPServerParameter(const CDHCPServer &comServer, QWidget *pParent = 0) const; 395 395 void cannotSaveDHCPServerParameter(const CDHCPServer &comServer, QWidget *pParent = 0) const; 396 void warnAboutDHCPServerIsNotEnabled(const QString &strName, QWidget *pParent = 0) const; 397 void warnAboutInvalidIPv4Address(const QString &strName, QWidget *pParent = 0) const; 398 void warnAboutInvalidIPv4Mask(const QString &strName, QWidget *pParent = 0) const; 399 void warnAboutInvalidIPv6Address(const QString &strName, QWidget *pParent = 0) const; 400 void warnAboutInvalidIPv6PrefixLength(const QString &strName, QWidget *pParent = 0) const; 401 void warnAboutInvalidDHCPServerAddress(const QString &strName, QWidget *pParent = 0) const; 402 void warnAboutInvalidDHCPServerMask(const QString &strName, QWidget *pParent = 0) const; 403 void warnAboutInvalidDHCPServerLowerAddress(const QString &strName, QWidget *pParent = 0) const; 404 void warnAboutInvalidDHCPServerUpperAddress(const QString &strName, QWidget *pParent = 0) const; 396 405 void cannotAcquireNATNetworks(const CVirtualBox &comVBox, QWidget *pParent = 0) const; 397 406 void cannotAcquireNATNetworkParameter(const CNATNetwork &comNetwork, QWidget *pParent = 0) const; -
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetHostNetwork.cpp
r87275 r87306 31 31 #include "UIIconPool.h" 32 32 #include "UIDetailsWidgetHostNetwork.h" 33 #include "UIMessageCenter.h" 33 34 #include "UINetworkManagerUtils.h" 34 35 … … 42 43 , m_enmEmbedding(enmEmbedding) 43 44 , m_pTabWidget(0) 44 , m_pButtonAutomatic(0) , m_pErrorPaneAutomatic(0)45 , m_pButtonManual(0) , m_pErrorPaneManual(0)46 , m_pLabelIPv4(0), m_pEditorIPv4(0) , m_pErrorPaneIPv4(0)47 , m_pLabelNMv4(0), m_pEditorNMv4(0) , m_pErrorPaneNMv4(0)48 , m_pLabelIPv6(0), m_pEditorIPv6(0) , m_pErrorPaneIPv6(0)49 , m_pLabelNMv6(0), m_pEditorNMv6(0) , m_pErrorPaneNMv6(0)45 , m_pButtonAutomatic(0) 46 , m_pButtonManual(0) 47 , m_pLabelIPv4(0), m_pEditorIPv4(0) 48 , m_pLabelNMv4(0), m_pEditorNMv4(0) 49 , m_pLabelIPv6(0), m_pEditorIPv6(0) 50 , m_pLabelNMv6(0), m_pEditorNMv6(0) 50 51 , m_pButtonBoxInterface(0) 51 52 , m_pCheckBoxDHCP(0) 52 , m_pLabelDHCPAddress(0), m_pEditorDHCPAddress(0) , m_pErrorPaneDHCPAddress(0)53 , m_pLabelDHCPMask(0), m_pEditorDHCPMask(0) , m_pErrorPaneDHCPMask(0)54 , m_pLabelDHCPLowerAddress(0), m_pEditorDHCPLowerAddress(0) , m_pErrorPaneDHCPLowerAddress(0)55 , m_pLabelDHCPUpperAddress(0), m_pEditorDHCPUpperAddress(0) , m_pErrorPaneDHCPUpperAddress(0)53 , m_pLabelDHCPAddress(0), m_pEditorDHCPAddress(0) 54 , m_pLabelDHCPMask(0), m_pEditorDHCPMask(0) 55 , m_pLabelDHCPLowerAddress(0), m_pEditorDHCPLowerAddress(0) 56 , m_pLabelDHCPUpperAddress(0), m_pEditorDHCPUpperAddress(0) 56 57 , m_pButtonBoxServer(0) 57 58 { … … 69 70 /* Load 'DHCP server' data: */ 70 71 loadDataForDHCPServer(); 72 } 73 74 bool UIDetailsWidgetHostNetwork::revalidate() const 75 { 76 /* Validate 'Interface' tab content: */ 77 if ( m_newData.m_interface.m_fDHCPEnabled 78 && !m_newData.m_dhcpserver.m_fEnabled) 79 { 80 msgCenter().warnAboutDHCPServerIsNotEnabled(m_newData.m_interface.m_strName); 81 return false; 82 } 83 if ( !m_newData.m_interface.m_fDHCPEnabled 84 && !m_newData.m_interface.m_strAddress.trimmed().isEmpty() 85 && ( !RTNetIsIPv4AddrStr(m_newData.m_interface.m_strAddress.toUtf8().constData()) 86 || RTNetStrIsIPv4AddrAny(m_newData.m_interface.m_strAddress.toUtf8().constData()))) 87 { 88 msgCenter().warnAboutInvalidIPv4Address(m_newData.m_interface.m_strName); 89 return false; 90 } 91 if ( !m_newData.m_interface.m_fDHCPEnabled 92 && !m_newData.m_interface.m_strMask.trimmed().isEmpty() 93 && ( !RTNetIsIPv4AddrStr(m_newData.m_interface.m_strMask.toUtf8().constData()) 94 || RTNetStrIsIPv4AddrAny(m_newData.m_interface.m_strMask.toUtf8().constData()))) 95 { 96 msgCenter().warnAboutInvalidIPv4Mask(m_newData.m_interface.m_strName); 97 return false; 98 } 99 if ( !m_newData.m_interface.m_fDHCPEnabled 100 && m_newData.m_interface.m_fSupportedIPv6 101 && !m_newData.m_interface.m_strAddress6.trimmed().isEmpty() 102 && ( !RTNetIsIPv6AddrStr(m_newData.m_interface.m_strAddress6.toUtf8().constData()) 103 || RTNetStrIsIPv6AddrAny(m_newData.m_interface.m_strAddress6.toUtf8().constData()))) 104 { 105 msgCenter().warnAboutInvalidIPv6Address(m_newData.m_interface.m_strName); 106 return false; 107 } 108 bool fIsMaskPrefixLengthNumber = false; 109 const int iMaskPrefixLength = m_newData.m_interface.m_strPrefixLength6.trimmed().toInt(&fIsMaskPrefixLengthNumber); 110 if ( !m_newData.m_interface.m_fDHCPEnabled 111 && m_newData.m_interface.m_fSupportedIPv6 112 && ( !fIsMaskPrefixLengthNumber 113 || iMaskPrefixLength < 0 114 || iMaskPrefixLength > 128)) 115 { 116 msgCenter().warnAboutInvalidIPv6PrefixLength(m_newData.m_interface.m_strName); 117 return false; 118 } 119 120 /* Validate 'DHCP server' tab content: */ 121 if ( m_newData.m_dhcpserver.m_fEnabled 122 && ( !RTNetIsIPv4AddrStr(m_newData.m_dhcpserver.m_strAddress.toUtf8().constData()) 123 || RTNetStrIsIPv4AddrAny(m_newData.m_dhcpserver.m_strAddress.toUtf8().constData()))) 124 { 125 msgCenter().warnAboutInvalidDHCPServerAddress(m_newData.m_interface.m_strName); 126 return false; 127 } 128 if ( m_newData.m_dhcpserver.m_fEnabled 129 && ( !RTNetIsIPv4AddrStr(m_newData.m_dhcpserver.m_strMask.toUtf8().constData()) 130 || RTNetStrIsIPv4AddrAny(m_newData.m_dhcpserver.m_strMask.toUtf8().constData()))) 131 { 132 msgCenter().warnAboutInvalidDHCPServerMask(m_newData.m_interface.m_strName); 133 return false; 134 } 135 if ( m_newData.m_dhcpserver.m_fEnabled 136 && ( !RTNetIsIPv4AddrStr(m_newData.m_dhcpserver.m_strLowerAddress.toUtf8().constData()) 137 || RTNetStrIsIPv4AddrAny(m_newData.m_dhcpserver.m_strLowerAddress.toUtf8().constData()))) 138 { 139 msgCenter().warnAboutInvalidDHCPServerLowerAddress(m_newData.m_interface.m_strName); 140 return false; 141 } 142 if ( m_newData.m_dhcpserver.m_fEnabled 143 && ( !RTNetIsIPv4AddrStr(m_newData.m_dhcpserver.m_strUpperAddress.toUtf8().constData()) 144 || RTNetStrIsIPv4AddrAny(m_newData.m_dhcpserver.m_strUpperAddress.toUtf8().constData()))) 145 { 146 msgCenter().warnAboutInvalidDHCPServerUpperAddress(m_newData.m_interface.m_strName); 147 return false; 148 } 149 150 /* True by default: */ 151 return true; 152 } 153 154 void UIDetailsWidgetHostNetwork::updateButtonStates() 155 { 156 // if (m_oldData != m_newData) 157 // printf("Interface: %s, %s, %s, %s; DHCP server: %d, %s, %s, %s, %s\n", 158 // m_newData.m_interface.m_strAddress.toUtf8().constData(), 159 // m_newData.m_interface.m_strMask.toUtf8().constData(), 160 // m_newData.m_interface.m_strAddress6.toUtf8().constData(), 161 // m_newData.m_interface.m_strPrefixLength6.toUtf8().constData(), 162 // (int)m_newData.m_dhcpserver.m_fEnabled, 163 // m_newData.m_dhcpserver.m_strAddress.toUtf8().constData(), 164 // m_newData.m_dhcpserver.m_strMask.toUtf8().constData(), 165 // m_newData.m_dhcpserver.m_strLowerAddress.toUtf8().constData(), 166 // m_newData.m_dhcpserver.m_strUpperAddress.toUtf8().constData()); 167 168 /* Update 'Apply' / 'Reset' button states: */ 169 if (m_pButtonBoxInterface) 170 { 171 m_pButtonBoxInterface->button(QDialogButtonBox::Cancel)->setEnabled(m_oldData != m_newData); 172 m_pButtonBoxInterface->button(QDialogButtonBox::Ok)->setEnabled(m_oldData != m_newData); 173 } 174 if (m_pButtonBoxServer) 175 { 176 m_pButtonBoxServer->button(QDialogButtonBox::Cancel)->setEnabled(m_oldData != m_newData); 177 m_pButtonBoxServer->button(QDialogButtonBox::Ok)->setEnabled(m_oldData != m_newData); 178 } 179 180 /* Notify listeners as well: */ 181 emit sigDataChanged(m_oldData != m_newData); 71 182 } 72 183 … … 150 261 setToolTip(tr("Apply Changes (%1)").arg(m_pButtonBoxServer->button(QDialogButtonBox::Ok)->shortcut().toString())); 151 262 } 152 153 /* Retranslate validation: */154 retranslateValidation();155 263 } 156 264 … … 159 267 m_newData.m_interface.m_fDHCPEnabled = fChecked; 160 268 loadDataForInterface(); 161 revalidate();162 269 updateButtonStates(); 163 270 } … … 167 274 m_newData.m_interface.m_fDHCPEnabled = !fChecked; 168 275 loadDataForInterface(); 169 revalidate();170 276 updateButtonStates(); 171 277 } … … 174 280 { 175 281 m_newData.m_interface.m_strAddress = strText; 176 revalidate(m_pErrorPaneIPv4);177 282 updateButtonStates(); 178 283 } … … 181 286 { 182 287 m_newData.m_interface.m_strMask = strText; 183 revalidate(m_pErrorPaneNMv4);184 288 updateButtonStates(); 185 289 } … … 188 292 { 189 293 m_newData.m_interface.m_strAddress6 = strText; 190 revalidate(m_pErrorPaneIPv6);191 294 updateButtonStates(); 192 295 } … … 195 298 { 196 299 m_newData.m_interface.m_strPrefixLength6 = strText; 197 revalidate(m_pErrorPaneNMv6);198 300 updateButtonStates(); 199 301 } … … 203 305 m_newData.m_dhcpserver.m_fEnabled = (bool)iChecked; 204 306 loadDataForDHCPServer(); 205 revalidate();206 307 updateButtonStates(); 207 308 } … … 210 311 { 211 312 m_newData.m_dhcpserver.m_strAddress = strText; 212 revalidate(m_pErrorPaneDHCPAddress);213 313 updateButtonStates(); 214 314 } … … 217 317 { 218 318 m_newData.m_dhcpserver.m_strMask = strText; 219 revalidate(m_pErrorPaneDHCPMask);220 319 updateButtonStates(); 221 320 } … … 224 323 { 225 324 m_newData.m_dhcpserver.m_strLowerAddress = strText; 226 revalidate(m_pErrorPaneDHCPLowerAddress);227 325 updateButtonStates(); 228 326 } … … 231 329 { 232 330 m_newData.m_dhcpserver.m_strUpperAddress = strText; 233 revalidate(m_pErrorPaneDHCPUpperAddress);234 331 updateButtonStates(); 235 332 } … … 314 411 #endif 315 412 316 /* Get the required icon metric: */317 const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);318 319 413 /* Prepare automatic interface configuration layout: */ 320 414 QHBoxLayout *pLayoutAutomatic = new QHBoxLayout; … … 330 424 this, &UIDetailsWidgetHostNetwork::sltToggledButtonAutomatic); 331 425 pLayoutAutomatic->addWidget(m_pButtonAutomatic); 332 }333 /* Prepare automatic interface configuration error pane: */334 m_pErrorPaneAutomatic = new QLabel(pTabInterface);335 if (m_pErrorPaneAutomatic)336 {337 m_pErrorPaneAutomatic->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);338 m_pErrorPaneAutomatic->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);339 m_pErrorPaneAutomatic->setPixmap(UIIconPool::iconSet(":/status_error_16px.png")340 .pixmap(QSize(iIconMetric, iIconMetric)));341 342 pLayoutAutomatic->addWidget(m_pErrorPaneAutomatic);343 426 } 344 427 … … 363 446 pLayoutManual->addWidget(m_pButtonManual); 364 447 } 365 /* Prepare manual interface configuration error pane: */366 m_pErrorPaneManual = new QLabel(pTabInterface);367 if (m_pErrorPaneManual)368 {369 m_pErrorPaneManual->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);370 m_pErrorPaneManual->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);371 m_pErrorPaneManual->setPixmap(UIIconPool::iconSet(":/status_error_16px.png")372 .pixmap(QSize(iIconMetric, iIconMetric)));373 374 pLayoutManual->addWidget(m_pErrorPaneManual);375 }376 448 377 449 pLayoutInterface->addLayout(pLayoutManual, 1, 0, 1, 3); … … 404 476 pLayoutIPv4->addWidget(m_pEditorIPv4); 405 477 } 406 /* Prepare IPv4 error pane: */407 m_pErrorPaneIPv4 = new QLabel(pTabInterface);408 if (m_pErrorPaneIPv4)409 {410 m_pErrorPaneIPv4->setAlignment(Qt::AlignCenter);411 m_pErrorPaneIPv4->setPixmap(UIIconPool::iconSet(":/status_error_16px.png")412 .pixmap(QSize(iIconMetric, iIconMetric)));413 414 pLayoutIPv4->addWidget(m_pErrorPaneIPv4);415 }416 478 417 479 pLayoutInterface->addLayout(pLayoutIPv4, 2, 2); … … 441 503 pLayoutNMv4->addWidget(m_pEditorNMv4); 442 504 } 443 /* Prepare NMv4 error pane: */444 m_pErrorPaneNMv4 = new QLabel(pTabInterface);445 if (m_pErrorPaneNMv4)446 {447 m_pErrorPaneNMv4->setAlignment(Qt::AlignCenter);448 m_pErrorPaneNMv4->setPixmap(UIIconPool::iconSet(":/status_error_16px.png")449 .pixmap(QSize(iIconMetric, iIconMetric)));450 451 pLayoutNMv4->addWidget(m_pErrorPaneNMv4);452 }453 505 454 506 pLayoutInterface->addLayout(pLayoutNMv4, 3, 2); … … 478 530 pLayoutIPv6->addWidget(m_pEditorIPv6); 479 531 } 480 /* Prepare IPv4 error pane: */481 m_pErrorPaneIPv6 = new QLabel(pTabInterface);482 if (m_pErrorPaneIPv6)483 {484 m_pErrorPaneIPv6->setAlignment(Qt::AlignCenter);485 m_pErrorPaneIPv6->setPixmap(UIIconPool::iconSet(":/status_error_16px.png")486 .pixmap(QSize(iIconMetric, iIconMetric)));487 488 pLayoutIPv6->addWidget(m_pErrorPaneIPv6);489 }490 532 491 533 pLayoutInterface->addLayout(pLayoutIPv6, 4, 2); … … 514 556 515 557 pLayoutNMv6->addWidget(m_pEditorNMv6); 516 }517 /* Prepare NMv6 error pane: */518 m_pErrorPaneNMv6 = new QLabel(pTabInterface);519 if (m_pErrorPaneNMv6)520 {521 m_pErrorPaneNMv6->setAlignment(Qt::AlignCenter);522 m_pErrorPaneNMv6->setPixmap(UIIconPool::iconSet(":/status_error_16px.png")523 .pixmap(QSize(iIconMetric, iIconMetric)));524 525 pLayoutNMv6->addWidget(m_pErrorPaneNMv6);526 558 } 527 559 … … 577 609 #endif 578 610 579 /* Get the required icon metric: */580 const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);581 582 611 /* Prepare DHCP server status check-box: */ 583 612 m_pCheckBoxDHCP = new QCheckBox(pTabDHCPServer); … … 615 644 pLayoutDHCPAddress->addWidget(m_pEditorDHCPAddress); 616 645 } 617 /* Prepare DHCP address error pane: */618 m_pErrorPaneDHCPAddress = new QLabel(pTabDHCPServer);619 if (m_pErrorPaneDHCPAddress)620 {621 m_pErrorPaneDHCPAddress->setAlignment(Qt::AlignCenter);622 m_pErrorPaneDHCPAddress->setPixmap(UIIconPool::iconSet(":/status_error_16px.png")623 .pixmap(QSize(iIconMetric, iIconMetric)));624 625 pLayoutDHCPAddress->addWidget(m_pErrorPaneDHCPAddress);626 }627 646 628 647 pLayoutDHCPServer->addLayout(pLayoutDHCPAddress, 1, 2); … … 652 671 pLayoutDHCPMask->addWidget(m_pEditorDHCPMask); 653 672 } 654 /* Prepare DHCP mask error pane: */655 m_pErrorPaneDHCPMask = new QLabel(pTabDHCPServer);656 if (m_pErrorPaneDHCPMask)657 {658 m_pErrorPaneDHCPMask->setAlignment(Qt::AlignCenter);659 m_pErrorPaneDHCPMask->setPixmap(UIIconPool::iconSet(":/status_error_16px.png")660 .pixmap(QSize(iIconMetric, iIconMetric)));661 662 pLayoutDHCPMask->addWidget(m_pErrorPaneDHCPMask);663 }664 673 665 674 pLayoutDHCPServer->addLayout(pLayoutDHCPMask, 2, 2); … … 689 698 pLayoutDHCPLowerAddress->addWidget(m_pEditorDHCPLowerAddress); 690 699 } 691 /* Prepare DHCP lower address error pane: */692 m_pErrorPaneDHCPLowerAddress = new QLabel(pTabDHCPServer);693 if (m_pErrorPaneDHCPLowerAddress)694 {695 m_pErrorPaneDHCPLowerAddress->setAlignment(Qt::AlignCenter);696 m_pErrorPaneDHCPLowerAddress->setPixmap(UIIconPool::iconSet(":/status_error_16px.png")697 .pixmap(QSize(iIconMetric, iIconMetric)));698 699 pLayoutDHCPLowerAddress->addWidget(m_pErrorPaneDHCPLowerAddress);700 }701 700 702 701 pLayoutDHCPServer->addLayout(pLayoutDHCPLowerAddress, 3, 2); … … 725 724 726 725 pLayoutDHCPUpperAddress->addWidget(m_pEditorDHCPUpperAddress); 727 }728 /* Prepare DHCP upper address error pane: */729 m_pErrorPaneDHCPUpperAddress = new QLabel(pTabDHCPServer);730 if (m_pErrorPaneDHCPUpperAddress)731 {732 m_pErrorPaneDHCPUpperAddress->setAlignment(Qt::AlignCenter);733 m_pErrorPaneDHCPUpperAddress->setPixmap(UIIconPool::iconSet(":/status_error_16px.png")734 .pixmap(QSize(iIconMetric, iIconMetric)));735 736 pLayoutDHCPUpperAddress->addWidget(m_pErrorPaneDHCPUpperAddress);737 726 } 738 727 … … 886 875 } 887 876 } 888 889 void UIDetailsWidgetHostNetwork::revalidate(QWidget *pWidget /* = 0 */)890 {891 /* Validate 'Interface' tab content: */892 if (m_pErrorPaneAutomatic && (!pWidget || pWidget == m_pErrorPaneAutomatic))893 {894 const bool fError = m_newData.m_interface.m_fDHCPEnabled895 && !m_newData.m_dhcpserver.m_fEnabled;896 m_pErrorPaneAutomatic->setVisible(fError);897 }898 if (m_pErrorPaneManual && (!pWidget || pWidget == m_pErrorPaneManual))899 {900 const bool fError = false;901 m_pErrorPaneManual->setVisible(fError);902 }903 if (m_pErrorPaneIPv4 && (!pWidget || pWidget == m_pErrorPaneIPv4))904 {905 const bool fError = !m_newData.m_interface.m_fDHCPEnabled906 && !m_newData.m_interface.m_strAddress.trimmed().isEmpty()907 && ( !RTNetIsIPv4AddrStr(m_newData.m_interface.m_strAddress.toUtf8().constData())908 || RTNetStrIsIPv4AddrAny(m_newData.m_interface.m_strAddress.toUtf8().constData()));909 m_pErrorPaneIPv4->setVisible(fError);910 }911 if (m_pErrorPaneNMv4 && (!pWidget || pWidget == m_pErrorPaneNMv4))912 {913 const bool fError = !m_newData.m_interface.m_fDHCPEnabled914 && !m_newData.m_interface.m_strMask.trimmed().isEmpty()915 && ( !RTNetIsIPv4AddrStr(m_newData.m_interface.m_strMask.toUtf8().constData())916 || RTNetStrIsIPv4AddrAny(m_newData.m_interface.m_strMask.toUtf8().constData()));917 m_pErrorPaneNMv4->setVisible(fError);918 }919 if (m_pErrorPaneIPv6 && (!pWidget || pWidget == m_pErrorPaneIPv6))920 {921 const bool fError = !m_newData.m_interface.m_fDHCPEnabled922 && m_newData.m_interface.m_fSupportedIPv6923 && !m_newData.m_interface.m_strAddress6.trimmed().isEmpty()924 && ( !RTNetIsIPv6AddrStr(m_newData.m_interface.m_strAddress6.toUtf8().constData())925 || RTNetStrIsIPv6AddrAny(m_newData.m_interface.m_strAddress6.toUtf8().constData()));926 m_pErrorPaneIPv6->setVisible(fError);927 }928 if (m_pErrorPaneNMv6 && (!pWidget || pWidget == m_pErrorPaneNMv6))929 {930 bool fIsMaskPrefixLengthNumber = false;931 const int iMaskPrefixLength = m_newData.m_interface.m_strPrefixLength6.trimmed().toInt(&fIsMaskPrefixLengthNumber);932 const bool fError = !m_newData.m_interface.m_fDHCPEnabled933 && m_newData.m_interface.m_fSupportedIPv6934 && ( !fIsMaskPrefixLengthNumber935 || iMaskPrefixLength < 0936 || iMaskPrefixLength > 128);937 m_pErrorPaneNMv6->setVisible(fError);938 }939 940 /* Validate 'DHCP server' tab content: */941 if (m_pErrorPaneDHCPAddress && (!pWidget || pWidget == m_pErrorPaneDHCPAddress))942 {943 const bool fError = m_newData.m_dhcpserver.m_fEnabled944 && ( !RTNetIsIPv4AddrStr(m_newData.m_dhcpserver.m_strAddress.toUtf8().constData())945 || RTNetStrIsIPv4AddrAny(m_newData.m_dhcpserver.m_strAddress.toUtf8().constData()));946 m_pErrorPaneDHCPAddress->setVisible(fError);947 }948 if (m_pErrorPaneDHCPMask && (!pWidget || pWidget == m_pErrorPaneDHCPMask))949 {950 const bool fError = m_newData.m_dhcpserver.m_fEnabled951 && ( !RTNetIsIPv4AddrStr(m_newData.m_dhcpserver.m_strMask.toUtf8().constData())952 || RTNetStrIsIPv4AddrAny(m_newData.m_dhcpserver.m_strMask.toUtf8().constData()));953 m_pErrorPaneDHCPMask->setVisible(fError);954 }955 if (m_pErrorPaneDHCPLowerAddress && (!pWidget || pWidget == m_pErrorPaneDHCPLowerAddress))956 {957 const bool fError = m_newData.m_dhcpserver.m_fEnabled958 && ( !RTNetIsIPv4AddrStr(m_newData.m_dhcpserver.m_strLowerAddress.toUtf8().constData())959 || RTNetStrIsIPv4AddrAny(m_newData.m_dhcpserver.m_strLowerAddress.toUtf8().constData()));960 m_pErrorPaneDHCPLowerAddress->setVisible(fError);961 }962 if (m_pErrorPaneDHCPUpperAddress && (!pWidget || pWidget == m_pErrorPaneDHCPUpperAddress))963 {964 const bool fError = m_newData.m_dhcpserver.m_fEnabled965 && ( !RTNetIsIPv4AddrStr(m_newData.m_dhcpserver.m_strUpperAddress.toUtf8().constData())966 || RTNetStrIsIPv4AddrAny(m_newData.m_dhcpserver.m_strUpperAddress.toUtf8().constData()));967 m_pErrorPaneDHCPUpperAddress->setVisible(fError);968 }969 970 /* Retranslate validation: */971 retranslateValidation(pWidget);972 }973 974 void UIDetailsWidgetHostNetwork::retranslateValidation(QWidget *pWidget /* = 0 */)975 {976 /* Translate 'Interface' tab content: */977 if (m_pErrorPaneAutomatic && (!pWidget || pWidget == m_pErrorPaneAutomatic))978 m_pErrorPaneAutomatic->setToolTip(tr("Host interface <nobr><b>%1</b></nobr> is set to obtain the address automatically "979 "but the corresponding DHCP server is not enabled.").arg(m_newData.m_interface.m_strName));980 if (m_pErrorPaneIPv4 && (!pWidget || pWidget == m_pErrorPaneIPv4))981 m_pErrorPaneIPv4->setToolTip(tr("Host interface <nobr><b>%1</b></nobr> does not currently have a valid "982 "IPv4 address.").arg(m_newData.m_interface.m_strName));983 if (m_pErrorPaneNMv4 && (!pWidget || pWidget == m_pErrorPaneNMv4))984 m_pErrorPaneNMv4->setToolTip(tr("Host interface <nobr><b>%1</b></nobr> does not currently have a valid "985 "IPv4 network mask.").arg(m_newData.m_interface.m_strName));986 if (m_pErrorPaneIPv6 && (!pWidget || pWidget == m_pErrorPaneIPv6))987 m_pErrorPaneIPv6->setToolTip(tr("Host interface <nobr><b>%1</b></nobr> does not currently have a valid "988 "IPv6 address.").arg(m_newData.m_interface.m_strName));989 if (m_pErrorPaneNMv6 && (!pWidget || pWidget == m_pErrorPaneNMv6))990 m_pErrorPaneNMv6->setToolTip(tr("Host interface <nobr><b>%1</b></nobr> does not currently have a valid "991 "IPv6 prefix length.").arg(m_newData.m_interface.m_strName));992 993 /* Translate 'DHCP server' tab content: */994 if (m_pErrorPaneDHCPAddress && (!pWidget || pWidget == m_pErrorPaneDHCPAddress))995 m_pErrorPaneDHCPAddress->setToolTip(tr("Host interface <nobr><b>%1</b></nobr> does not currently have a valid "996 "DHCP server address.").arg(m_newData.m_interface.m_strName));997 if (m_pErrorPaneDHCPMask && (!pWidget || pWidget == m_pErrorPaneDHCPMask))998 m_pErrorPaneDHCPMask->setToolTip(tr("Host interface <nobr><b>%1</b></nobr> does not currently have a valid "999 "DHCP server mask.").arg(m_newData.m_interface.m_strName));1000 if (m_pErrorPaneDHCPLowerAddress && (!pWidget || pWidget == m_pErrorPaneDHCPLowerAddress))1001 m_pErrorPaneDHCPLowerAddress->setToolTip(tr("Host interface <nobr><b>%1</b></nobr> does not currently have a valid "1002 "DHCP server lower address bound.").arg(m_newData.m_interface.m_strName));1003 if (m_pErrorPaneDHCPUpperAddress && (!pWidget || pWidget == m_pErrorPaneDHCPUpperAddress))1004 m_pErrorPaneDHCPUpperAddress->setToolTip(tr("Host interface <nobr><b>%1</b></nobr> does not currently have a valid "1005 "DHCP server upper address bound.").arg(m_newData.m_interface.m_strName));1006 }1007 1008 void UIDetailsWidgetHostNetwork::updateButtonStates()1009 {1010 // if (m_oldData != m_newData)1011 // printf("Interface: %s, %s, %s, %s; DHCP server: %d, %s, %s, %s, %s\n",1012 // m_newData.m_interface.m_strAddress.toUtf8().constData(),1013 // m_newData.m_interface.m_strMask.toUtf8().constData(),1014 // m_newData.m_interface.m_strAddress6.toUtf8().constData(),1015 // m_newData.m_interface.m_strPrefixLength6.toUtf8().constData(),1016 // (int)m_newData.m_dhcpserver.m_fEnabled,1017 // m_newData.m_dhcpserver.m_strAddress.toUtf8().constData(),1018 // m_newData.m_dhcpserver.m_strMask.toUtf8().constData(),1019 // m_newData.m_dhcpserver.m_strLowerAddress.toUtf8().constData(),1020 // m_newData.m_dhcpserver.m_strUpperAddress.toUtf8().constData());1021 1022 /* Update 'Apply' / 'Reset' button states: */1023 if (m_pButtonBoxInterface)1024 {1025 m_pButtonBoxInterface->button(QDialogButtonBox::Cancel)->setEnabled(m_oldData != m_newData);1026 m_pButtonBoxInterface->button(QDialogButtonBox::Ok)->setEnabled(m_oldData != m_newData);1027 }1028 if (m_pButtonBoxServer)1029 {1030 m_pButtonBoxServer->button(QDialogButtonBox::Cancel)->setEnabled(m_oldData != m_newData);1031 m_pButtonBoxServer->button(QDialogButtonBox::Ok)->setEnabled(m_oldData != m_newData);1032 }1033 1034 /* Notify listeners as well: */1035 emit sigDataChanged(m_oldData != m_newData);1036 } -
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetHostNetwork.h
r87275 r87306 191 191 void setData(const UIDataHostNetwork &data); 192 192 193 /** @name Change handling stuff. 194 * @{ */ 195 /** Revalidates changes for passed @a pWidget. */ 196 bool revalidate() const; 197 198 /** Updates button states. */ 199 void updateButtonStates(); 200 /** @} */ 201 193 202 protected: 194 203 … … 252 261 /** @} */ 253 262 254 /** @name Change handling stuff.255 * @{ */256 /** Revalidates changes for passed @a pWidget. */257 void revalidate(QWidget *pWidget = 0);258 /** Retranslates validation for passed @a pWidget. */259 void retranslateValidation(QWidget *pWidget = 0);260 /** Updates button states. */261 void updateButtonStates();262 /** @} */263 264 263 /** @name General variables. 265 264 * @{ */ … … 280 279 /** Holds the automatic interface configuration button. */ 281 280 QRadioButton *m_pButtonAutomatic; 282 /** Holds the automatic interface configuration error pane. */283 QLabel *m_pErrorPaneAutomatic;284 281 285 282 /** Holds the manual interface configuration button. */ 286 283 QRadioButton *m_pButtonManual; 287 /** Holds the manual interface configuration error pane. */288 QLabel *m_pErrorPaneManual;289 284 290 285 /** Holds the IPv4 address label. */ … … 292 287 /** Holds the IPv4 address editor. */ 293 288 QILineEdit *m_pEditorIPv4; 294 /** Holds the IPv4 address error pane. */295 QLabel *m_pErrorPaneIPv4;296 289 297 290 /** Holds the IPv4 network mask label. */ … … 299 292 /** Holds the IPv4 network mask editor. */ 300 293 QILineEdit *m_pEditorNMv4; 301 /** Holds the IPv4 network mask error pane. */302 QLabel *m_pErrorPaneNMv4;303 294 304 295 /** Holds the IPv6 address label. */ … … 306 297 /** Holds the IPv6 address editor. */ 307 298 QILineEdit *m_pEditorIPv6; 308 /** Holds the IPv6 address error pane. */309 QLabel *m_pErrorPaneIPv6;310 299 311 300 /** Holds the IPv6 network mask label. */ … … 313 302 /** Holds the IPv6 network mask editor. */ 314 303 QILineEdit *m_pEditorNMv6; 315 /** Holds the IPv6 network mask error pane. */316 QLabel *m_pErrorPaneNMv6;317 304 318 305 /** Holds the interface button-box instance. */ … … 329 316 /** Holds the DHCP address editor. */ 330 317 QILineEdit *m_pEditorDHCPAddress; 331 /** Holds the DHCP address error pane. */332 QLabel *m_pErrorPaneDHCPAddress;333 318 334 319 /** Holds the DHCP network mask label. */ … … 336 321 /** Holds the DHCP network mask editor. */ 337 322 QILineEdit *m_pEditorDHCPMask; 338 /** Holds the DHCP network mask error pane. */339 QLabel *m_pErrorPaneDHCPMask;340 323 341 324 /** Holds the DHCP lower address label. */ … … 343 326 /** Holds the DHCP lower address editor. */ 344 327 QILineEdit *m_pEditorDHCPLowerAddress; 345 /** Holds the DHCP lower address error pane. */346 QLabel *m_pErrorPaneDHCPLowerAddress;347 328 348 329 /** Holds the DHCP upper address label. */ … … 350 331 /** Holds the DHCP upper address editor. */ 351 332 QILineEdit *m_pEditorDHCPUpperAddress; 352 /** Holds the DHCP upper address error pane. */353 QLabel *m_pErrorPaneDHCPUpperAddress;354 333 355 334 /** Holds the server button-box instance. */ -
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetNATNetwork.cpp
r87305 r87306 74 74 } 75 75 76 bool UIDetailsWidgetNATNetwork::revalidate() 76 bool UIDetailsWidgetNATNetwork::revalidate() const 77 77 { 78 78 return m_pForwardingTableIPv4->validate() && m_pForwardingTableIPv6->validate(); -
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetNATNetwork.h
r87305 r87306 128 128 * @{ */ 129 129 /** Revalidates changes. */ 130 bool revalidate() ;130 bool revalidate() const; 131 131 132 132 /** Updates button states. */ -
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.cpp
r87305 r87306 882 882 AssertMsgReturnVoid(m_pDetailsWidgetHostNetwork, ("Host network details-widget isn't created!\n")); 883 883 884 /* Get item data: */ 885 UIDataHostNetwork oldData = *pItem; 886 UIDataHostNetwork newData = m_pDetailsWidgetHostNetwork->data(); 887 888 /* Get host for further activities: */ 889 CHost comHost = uiCommon().host(); 890 891 /* Find corresponding interface: */ 892 CHostNetworkInterface comInterface = comHost.FindHostNetworkInterfaceByName(oldData.m_interface.m_strName); 893 894 /* Show error message if necessary: */ 895 if (!comHost.isOk() || comInterface.isNull()) 896 msgCenter().cannotFindHostNetworkInterface(comHost, oldData.m_interface.m_strName, this); 897 else 898 { 899 /* Save automatic interface configuration: */ 900 if (newData.m_interface.m_fDHCPEnabled) 901 { 902 if ( comInterface.isOk() 903 && !oldData.m_interface.m_fDHCPEnabled) 904 comInterface.EnableDynamicIPConfig(); 905 } 906 /* Save manual interface configuration: */ 884 /* Revalidate host network details: */ 885 if (m_pDetailsWidgetHostNetwork->revalidate()) 886 { 887 /* Get item data: */ 888 UIDataHostNetwork oldData = *pItem; 889 UIDataHostNetwork newData = m_pDetailsWidgetHostNetwork->data(); 890 891 /* Get host for further activities: */ 892 CHost comHost = uiCommon().host(); 893 894 /* Find corresponding interface: */ 895 CHostNetworkInterface comInterface = comHost.FindHostNetworkInterfaceByName(oldData.m_interface.m_strName); 896 897 /* Show error message if necessary: */ 898 if (!comHost.isOk() || comInterface.isNull()) 899 msgCenter().cannotFindHostNetworkInterface(comHost, oldData.m_interface.m_strName, this); 907 900 else 908 901 { 909 /* Save IPv4 interface configuration: */ 910 if ( comInterface.isOk() 911 && ( oldData.m_interface.m_fDHCPEnabled 912 || newData.m_interface.m_strAddress != oldData.m_interface.m_strAddress 913 || newData.m_interface.m_strMask != oldData.m_interface.m_strMask)) 914 comInterface.EnableStaticIPConfig(newData.m_interface.m_strAddress, newData.m_interface.m_strMask); 915 /* Save IPv6 interface configuration: */ 916 if ( comInterface.isOk() 917 && newData.m_interface.m_fSupportedIPv6 918 && ( oldData.m_interface.m_fDHCPEnabled 919 || newData.m_interface.m_strAddress6 != oldData.m_interface.m_strAddress6 920 || newData.m_interface.m_strPrefixLength6 != oldData.m_interface.m_strPrefixLength6)) 921 comInterface.EnableStaticIPConfigV6(newData.m_interface.m_strAddress6, newData.m_interface.m_strPrefixLength6.toULong()); 922 } 923 924 /* Show error message if necessary: */ 925 if (!comInterface.isOk()) 926 msgCenter().cannotSaveHostNetworkInterfaceParameter(comInterface, this); 927 else 928 { 929 /* Get network name for further activities: */ 930 const QString strNetworkName = comInterface.GetNetworkName(); 902 /* Save automatic interface configuration: */ 903 if (newData.m_interface.m_fDHCPEnabled) 904 { 905 if ( comInterface.isOk() 906 && !oldData.m_interface.m_fDHCPEnabled) 907 comInterface.EnableDynamicIPConfig(); 908 } 909 /* Save manual interface configuration: */ 910 else 911 { 912 /* Save IPv4 interface configuration: */ 913 if ( comInterface.isOk() 914 && ( oldData.m_interface.m_fDHCPEnabled 915 || newData.m_interface.m_strAddress != oldData.m_interface.m_strAddress 916 || newData.m_interface.m_strMask != oldData.m_interface.m_strMask)) 917 comInterface.EnableStaticIPConfig(newData.m_interface.m_strAddress, newData.m_interface.m_strMask); 918 /* Save IPv6 interface configuration: */ 919 if ( comInterface.isOk() 920 && newData.m_interface.m_fSupportedIPv6 921 && ( oldData.m_interface.m_fDHCPEnabled 922 || newData.m_interface.m_strAddress6 != oldData.m_interface.m_strAddress6 923 || newData.m_interface.m_strPrefixLength6 != oldData.m_interface.m_strPrefixLength6)) 924 comInterface.EnableStaticIPConfigV6(newData.m_interface.m_strAddress6, newData.m_interface.m_strPrefixLength6.toULong()); 925 } 931 926 932 927 /* Show error message if necessary: */ 933 928 if (!comInterface.isOk()) 934 msgCenter().cannot AcquireHostNetworkInterfaceParameter(comInterface, this);929 msgCenter().cannotSaveHostNetworkInterfaceParameter(comInterface, this); 935 930 else 936 931 { 937 /* Get VBox for further activities: */ 938 CVirtualBox comVBox = uiCommon().virtualBox(); 939 940 /* Find corresponding DHCP server (create if necessary): */ 941 CDHCPServer comServer = comVBox.FindDHCPServerByNetworkName(strNetworkName); 942 if (!comVBox.isOk() || comServer.isNull()) 943 comServer = comVBox.CreateDHCPServer(strNetworkName); 932 /* Get network name for further activities: */ 933 const QString strNetworkName = comInterface.GetNetworkName(); 944 934 945 935 /* Show error message if necessary: */ 946 if (!com VBox.isOk() || comServer.isNull())947 msgCenter().cannot CreateDHCPServer(comVBox, strNetworkName, this);936 if (!comInterface.isOk()) 937 msgCenter().cannotAcquireHostNetworkInterfaceParameter(comInterface, this); 948 938 else 949 939 { 950 /* Save whether DHCP server is enabled: */ 951 if ( comServer.isOk() 952 && newData.m_dhcpserver.m_fEnabled != oldData.m_dhcpserver.m_fEnabled) 953 comServer.SetEnabled(newData.m_dhcpserver.m_fEnabled); 954 /* Save DHCP server configuration: */ 955 if ( comServer.isOk() 956 && newData.m_dhcpserver.m_fEnabled 957 && ( newData.m_dhcpserver.m_strAddress != oldData.m_dhcpserver.m_strAddress 958 || newData.m_dhcpserver.m_strMask != oldData.m_dhcpserver.m_strMask 959 || newData.m_dhcpserver.m_strLowerAddress != oldData.m_dhcpserver.m_strLowerAddress 960 || newData.m_dhcpserver.m_strUpperAddress != oldData.m_dhcpserver.m_strUpperAddress)) 961 comServer.SetConfiguration(newData.m_dhcpserver.m_strAddress, newData.m_dhcpserver.m_strMask, 962 newData.m_dhcpserver.m_strLowerAddress, newData.m_dhcpserver.m_strUpperAddress); 940 /* Get VBox for further activities: */ 941 CVirtualBox comVBox = uiCommon().virtualBox(); 942 943 /* Find corresponding DHCP server (create if necessary): */ 944 CDHCPServer comServer = comVBox.FindDHCPServerByNetworkName(strNetworkName); 945 if (!comVBox.isOk() || comServer.isNull()) 946 comServer = comVBox.CreateDHCPServer(strNetworkName); 963 947 964 948 /* Show error message if necessary: */ 965 if (!comServer.isOk()) 966 msgCenter().cannotSaveDHCPServerParameter(comServer, this); 949 if (!comVBox.isOk() || comServer.isNull()) 950 msgCenter().cannotCreateDHCPServer(comVBox, strNetworkName, this); 951 else 952 { 953 /* Save whether DHCP server is enabled: */ 954 if ( comServer.isOk() 955 && newData.m_dhcpserver.m_fEnabled != oldData.m_dhcpserver.m_fEnabled) 956 comServer.SetEnabled(newData.m_dhcpserver.m_fEnabled); 957 /* Save DHCP server configuration: */ 958 if ( comServer.isOk() 959 && newData.m_dhcpserver.m_fEnabled 960 && ( newData.m_dhcpserver.m_strAddress != oldData.m_dhcpserver.m_strAddress 961 || newData.m_dhcpserver.m_strMask != oldData.m_dhcpserver.m_strMask 962 || newData.m_dhcpserver.m_strLowerAddress != oldData.m_dhcpserver.m_strLowerAddress 963 || newData.m_dhcpserver.m_strUpperAddress != oldData.m_dhcpserver.m_strUpperAddress)) 964 comServer.SetConfiguration(newData.m_dhcpserver.m_strAddress, newData.m_dhcpserver.m_strMask, 965 newData.m_dhcpserver.m_strLowerAddress, newData.m_dhcpserver.m_strUpperAddress); 966 967 /* Show error message if necessary: */ 968 if (!comServer.isOk()) 969 msgCenter().cannotSaveDHCPServerParameter(comServer, this); 970 } 967 971 } 968 972 } 973 974 /* Find corresponding interface again (if necessary): */ 975 if (!comInterface.isOk()) 976 { 977 comInterface = comHost.FindHostNetworkInterfaceByName(oldData.m_interface.m_strName); 978 979 /* Show error message if necessary: */ 980 if (!comHost.isOk() || comInterface.isNull()) 981 msgCenter().cannotFindHostNetworkInterface(comHost, oldData.m_interface.m_strName, this); 982 } 983 984 /* If interface is Ok now: */ 985 if (comInterface.isNotNull() && comInterface.isOk()) 986 { 987 /* Update interface in the tree: */ 988 UIDataHostNetwork data; 989 loadHostNetwork(comInterface, data); 990 updateItemForHostNetwork(data, true, pItem); 991 992 /* Make sure current item fetched: */ 993 sltHandleCurrentItemChangeHostNetwork(); 994 995 /* Adjust tree-widgets: */ 996 sltAdjustTreeWidgets(); 997 } 969 998 } 970 971 /* Find corresponding interface again (if necessary): */ 972 if (!comInterface.isOk()) 973 { 974 comInterface = comHost.FindHostNetworkInterfaceByName(oldData.m_interface.m_strName); 975 976 /* Show error message if necessary: */ 977 if (!comHost.isOk() || comInterface.isNull()) 978 msgCenter().cannotFindHostNetworkInterface(comHost, oldData.m_interface.m_strName, this); 979 } 980 981 /* If interface is Ok now: */ 982 if (comInterface.isNotNull() && comInterface.isOk()) 983 { 984 /* Update interface in the tree: */ 985 UIDataHostNetwork data; 986 loadHostNetwork(comInterface, data); 987 updateItemForHostNetwork(data, true, pItem); 988 989 /* Make sure current item fetched: */ 990 sltHandleCurrentItemChangeHostNetwork(); 991 992 /* Adjust tree-widgets: */ 993 sltAdjustTreeWidgets(); 994 } 995 } 999 } 1000 1001 /* Make sure button states updated: */ 1002 m_pDetailsWidgetHostNetwork->updateButtonStates(); 996 1003 } 997 1004
Note:
See TracChangeset
for help on using the changeset viewer.