Changeset 92821 in vbox
- Timestamp:
- Dec 8, 2021 2:54:01 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 8 edited
-
globals/UIMessageCenter.cpp (modified) (1 diff)
-
globals/UIMessageCenter.h (modified) (1 diff)
-
networkmanager/UIDetailsWidgetHostNetwork.cpp (modified) (13 diffs)
-
networkmanager/UIDetailsWidgetHostNetwork.h (modified) (9 diffs)
-
networkmanager/UINetworkManager.cpp (modified) (24 diffs)
-
networkmanager/UINetworkManager.h (modified) (4 diffs)
-
notificationcenter/UINotificationObjects.cpp (modified) (5 diffs)
-
notificationcenter/UINotificationObjects.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r92811 r92821 1341 1341 } 1342 1342 1343 bool UIMessageCenter::confirmHostOnlyNetworkRemoval(const QString &strName, QWidget *pParent /* = 0 */) const 1344 { 1345 return questionBinary(pParent, MessageType_Question, 1346 tr("<p>Do you want to remove the host-only network <nobr><b>%1</b>?</nobr></p>" 1347 "<p>If this network is in use by one or more virtual " 1348 "machine network adapters these adapters will no longer be " 1349 "usable until you correct their settings by either choosing " 1350 "a different network name or a different adapter attachment " 1351 "type.</p>") 1352 .arg(strName), 1353 0 /* auto-confirm id */, 1354 tr("Remove") /* ok button text */, 1355 QString() /* cancel button text */, 1356 false /* ok button by default? */); 1357 } 1358 1343 1359 bool UIMessageCenter::confirmNATNetworkRemoval(const QString &strName, QWidget *pParent /* = 0*/) const 1344 1360 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r92811 r92821 358 358 bool confirmCloudNetworkRemoval(const QString &strName, QWidget *pParent = 0) const; 359 359 bool confirmHostNetworkInterfaceRemoval(const QString &strName, QWidget *pParent = 0) const; 360 bool confirmHostOnlyNetworkRemoval(const QString &strName, QWidget *pParent = 0) const; 360 361 bool confirmNATNetworkRemoval(const QString &strName, QWidget *pParent = 0) const; 361 362 /** @} */ -
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetHostNetwork.cpp
r92811 r92821 43 43 : QIWithRetranslateUI<QWidget>(pParent) 44 44 , m_enmEmbedding(enmEmbedding) 45 #ifdef VBOX_WS_MAC 46 , m_pLabelName(0) 47 , m_pEditorName(0) 48 , m_pLabelMask(0) 49 , m_pEditorMask(0) 50 , m_pLabelLBnd(0) 51 , m_pEditorLBnd(0) 52 , m_pLabelUBnd(0) 53 , m_pEditorUBnd(0) 54 , m_pButtonBox(0) 55 #else /* !VBOX_WS_MAC */ 45 56 , m_pTabWidget(0) 46 57 , m_pButtonAutomatic(0) … … 57 68 , m_pLabelDHCPUpperAddress(0), m_pEditorDHCPUpperAddress(0) 58 69 , m_pButtonBoxServer(0) 70 #endif /* !VBOX_WS_MAC */ 59 71 { 60 72 prepare(); 61 73 } 62 74 75 #ifdef VBOX_WS_MAC 76 void UIDetailsWidgetHostNetwork::setData(const UIDataHostNetwork &data, 77 const QStringList &busyNames /* = QStringList() */) 78 #else /* !VBOX_WS_MAC */ 63 79 void UIDetailsWidgetHostNetwork::setData(const UIDataHostNetwork &data) 80 #endif /* !VBOX_WS_MAC */ 64 81 { 65 82 /* Cache old/new data: */ 66 83 m_oldData = data; 67 84 m_newData = m_oldData; 68 85 #ifdef VBOX_WS_MAC 86 m_busyNames = busyNames; 87 #endif /* VBOX_WS_MAC */ 88 89 #ifdef VBOX_WS_MAC 90 /* Load data: */ 91 loadData(); 92 #else /* !VBOX_WS_MAC */ 69 93 /* Load 'Interface' data: */ 70 94 loadDataForInterface(); 71 95 /* Load 'DHCP server' data: */ 72 96 loadDataForDHCPServer(); 97 #endif /* !VBOX_WS_MAC */ 73 98 } 74 99 75 100 bool UIDetailsWidgetHostNetwork::revalidate() const 76 101 { 102 #ifdef VBOX_WS_MAC 103 /* Make sure network name isn't empty: */ 104 if (m_newData.m_strName.isEmpty()) 105 { 106 UINotificationMessage::warnAboutNoNameSpecified(m_oldData.m_strName); 107 return false; 108 } 109 else 110 { 111 /* Make sure item names are unique: */ 112 if (m_busyNames.contains(m_newData.m_strName)) 113 { 114 UINotificationMessage::warnAboutNameAlreadyBusy(m_newData.m_strName); 115 return false; 116 } 117 } 118 119 /* Make sure mask isn't empty: */ 120 if (m_newData.m_strMask.isEmpty()) 121 { 122 UINotificationMessage::warnAboutInvalidIPv4Mask(m_newData.m_strMask); 123 return false; 124 } 125 /* Make sure lower bound isn't empty: */ 126 if (m_newData.m_strLBnd.isEmpty()) 127 { 128 UINotificationMessage::warnAboutInvalidDHCPServerLowerAddress(m_newData.m_strLBnd); 129 return false; 130 } 131 /* Make sure upper bound isn't empty: */ 132 if (m_newData.m_strUBnd.isEmpty()) 133 { 134 UINotificationMessage::warnAboutInvalidDHCPServerUpperAddress(m_newData.m_strUBnd); 135 return false; 136 } 137 138 #else /* !VBOX_WS_MAC */ 139 77 140 /* Validate 'Interface' tab content: */ 78 141 if ( m_newData.m_interface.m_fDHCPEnabled … … 148 211 return false; 149 212 } 213 #endif /* !VBOX_WS_MAC */ 150 214 151 215 /* True by default: */ … … 167 231 // m_newData.m_dhcpserver.m_strUpperAddress.toUtf8().constData()); 168 232 233 #ifdef VBOX_WS_MAC 234 /* Update 'Apply' / 'Reset' button states: */ 235 if (m_pButtonBox) 236 { 237 m_pButtonBox->button(QDialogButtonBox::Cancel)->setEnabled(m_oldData != m_newData); 238 m_pButtonBox->button(QDialogButtonBox::Ok)->setEnabled(m_oldData != m_newData); 239 } 240 #else /* !VBOX_WS_MAC */ 169 241 /* Update 'Apply' / 'Reset' button states: */ 170 242 if (m_pButtonBoxInterface) … … 178 250 m_pButtonBoxServer->button(QDialogButtonBox::Ok)->setEnabled(m_oldData != m_newData); 179 251 } 252 #endif /* !VBOX_WS_MAC */ 180 253 181 254 /* Notify listeners as well: */ … … 185 258 void UIDetailsWidgetHostNetwork::retranslateUi() 186 259 { 260 #ifdef VBOX_WS_MAC 261 if (m_pLabelName) 262 m_pLabelName->setText(tr("&Name:")); 263 if (m_pEditorName) 264 m_pEditorName->setToolTip(tr("Holds the name for this network.")); 265 if (m_pLabelMask) 266 m_pLabelMask->setText(tr("&Mask:")); 267 if (m_pEditorMask) 268 m_pEditorMask->setToolTip(tr("Holds the mask for this network.")); 269 if (m_pLabelLBnd) 270 m_pLabelLBnd->setText(tr("&Lower Bound:")); 271 if (m_pEditorLBnd) 272 m_pEditorLBnd->setToolTip(tr("Holds the lower address bound for this network.")); 273 if (m_pLabelUBnd) 274 m_pLabelUBnd->setText(tr("&Upper Bound:")); 275 if (m_pEditorUBnd) 276 m_pEditorUBnd->setToolTip(tr("Holds the upper address bound for this network.")); 277 if (m_pButtonBox) 278 { 279 m_pButtonBox->button(QDialogButtonBox::Cancel)->setText(tr("Reset")); 280 m_pButtonBox->button(QDialogButtonBox::Ok)->setText(tr("Apply")); 281 m_pButtonBox->button(QDialogButtonBox::Cancel)->setShortcut(Qt::Key_Escape); 282 m_pButtonBox->button(QDialogButtonBox::Ok)->setShortcut(QString("Ctrl+Return")); 283 m_pButtonBox->button(QDialogButtonBox::Cancel)->setStatusTip(tr("Reset changes in current network details")); 284 m_pButtonBox->button(QDialogButtonBox::Ok)->setStatusTip(tr("Apply changes in current network details")); 285 m_pButtonBox->button(QDialogButtonBox::Cancel)-> 286 setToolTip(tr("Reset Changes (%1)").arg(m_pButtonBox->button(QDialogButtonBox::Cancel)->shortcut().toString())); 287 m_pButtonBox->button(QDialogButtonBox::Ok)-> 288 setToolTip(tr("Apply Changes (%1)").arg(m_pButtonBox->button(QDialogButtonBox::Ok)->shortcut().toString())); 289 } 290 291 #else /* !VBOX_WS_MAC */ 292 187 293 /* Translate tab-widget: */ 188 294 if (m_pTabWidget) … … 262 368 setToolTip(tr("Apply Changes (%1)").arg(m_pButtonBoxServer->button(QDialogButtonBox::Ok)->shortcut().toString())); 263 369 } 264 } 370 #endif /* !VBOX_WS_MAC */ 371 } 372 373 #ifdef VBOX_WS_MAC 374 void UIDetailsWidgetHostNetwork::sltTextChangedName(const QString &strText) 375 { 376 m_newData.m_strName = strText; 377 updateButtonStates(); 378 } 379 380 void UIDetailsWidgetHostNetwork::sltTextChangedMask(const QString &strText) 381 { 382 m_newData.m_strMask = strText; 383 updateButtonStates(); 384 } 385 386 void UIDetailsWidgetHostNetwork::sltTextChangedLBnd(const QString &strText) 387 { 388 m_newData.m_strLBnd = strText; 389 updateButtonStates(); 390 } 391 392 void UIDetailsWidgetHostNetwork::sltTextChangedUBnd(const QString &strText) 393 { 394 m_newData.m_strUBnd = strText; 395 updateButtonStates(); 396 } 397 398 #else /* !VBOX_WS_MAC */ 265 399 266 400 void UIDetailsWidgetHostNetwork::sltToggledButtonAutomatic(bool fChecked) … … 332 466 updateButtonStates(); 333 467 } 468 #endif /* !VBOX_WS_MAC */ 334 469 335 470 void UIDetailsWidgetHostNetwork::sltHandleButtonBoxClick(QAbstractButton *pButton) 336 471 { 472 #ifdef VBOX_WS_MAC 473 /* Make sure button-box exists: */ 474 if (!m_pButtonBox) 475 return; 476 477 /* Disable buttons first of all: */ 478 m_pButtonBox->button(QDialogButtonBox::Cancel)->setEnabled(false); 479 m_pButtonBox->button(QDialogButtonBox::Ok)->setEnabled(false); 480 481 /* Compare with known buttons: */ 482 if ( pButton == m_pButtonBox->button(QDialogButtonBox::Cancel)) 483 emit sigDataChangeRejected(); 484 else 485 if ( pButton == m_pButtonBox->button(QDialogButtonBox::Ok)) 486 emit sigDataChangeAccepted(); 487 488 #else /* !VBOX_WS_MAC */ 489 337 490 /* Make sure button-boxes exist: */ 338 491 if (!m_pButtonBoxInterface || !m_pButtonBoxServer) … … 353 506 || pButton == m_pButtonBoxServer->button(QDialogButtonBox::Ok)) 354 507 emit sigDataChangeAccepted(); 508 #endif /* !VBOX_WS_MAC */ 355 509 } 356 510 … … 369 523 void UIDetailsWidgetHostNetwork::prepareThis() 370 524 { 525 #ifdef VBOX_WS_MAC 526 /* Create layout: */ 527 QGridLayout *pLayout = new QGridLayout(this); 528 if (pLayout) 529 { 530 // really macOS only: 531 pLayout->setSpacing(10); 532 pLayout->setContentsMargins(10, 10, 10, 10); 533 534 /* Prepare options: */ 535 prepareOptions(); 536 } 537 538 #else /* !VBOX_WS_MAC */ 539 371 540 /* Create layout: */ 372 541 new QVBoxLayout(this); … … 379 548 prepareTabWidget(); 380 549 } 381 } 550 #endif /* !VBOX_WS_MAC */ 551 } 552 553 #ifdef VBOX_WS_MAC 554 void UIDetailsWidgetHostNetwork::prepareOptions() 555 { 556 /* Acquire layout: */ 557 QGridLayout *pLayout = static_cast<QGridLayout*>(layout()); 558 if (pLayout) 559 { 560 /* Prepare name label: */ 561 m_pLabelName = new QLabel(this); 562 if (m_pLabelName) 563 { 564 m_pLabelName->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 565 pLayout->addWidget(m_pLabelName, 0, 0); 566 } 567 /* Prepare name editor: */ 568 m_pEditorName = new QILineEdit(this); 569 if (m_pEditorName) 570 { 571 m_pLabelName->setBuddy(m_pEditorName); 572 connect(m_pEditorName, &QLineEdit::textChanged, 573 this, &UIDetailsWidgetHostNetwork::sltTextChangedName); 574 575 pLayout->addWidget(m_pEditorName, 0, 1); 576 } 577 578 /* Prepare mask label: */ 579 m_pLabelMask = new QLabel(this); 580 if (m_pLabelMask) 581 { 582 m_pLabelMask->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 583 pLayout->addWidget(m_pLabelMask, 1, 0); 584 } 585 /* Prepare mask editor: */ 586 m_pEditorMask = new QILineEdit(this); 587 if (m_pEditorMask) 588 { 589 m_pLabelMask->setBuddy(m_pEditorMask); 590 connect(m_pEditorMask, &QLineEdit::textChanged, 591 this, &UIDetailsWidgetHostNetwork::sltTextChangedMask); 592 593 pLayout->addWidget(m_pEditorMask, 1, 1); 594 } 595 596 /* Prepare lower bound label: */ 597 m_pLabelLBnd = new QLabel(this); 598 if (m_pLabelLBnd) 599 { 600 m_pLabelLBnd->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 601 pLayout->addWidget(m_pLabelLBnd, 2, 0); 602 } 603 /* Prepare lower bound editor: */ 604 m_pEditorLBnd = new QILineEdit(this); 605 if (m_pEditorLBnd) 606 { 607 m_pLabelLBnd->setBuddy(m_pEditorLBnd); 608 connect(m_pEditorLBnd, &QLineEdit::textChanged, 609 this, &UIDetailsWidgetHostNetwork::sltTextChangedLBnd); 610 611 pLayout->addWidget(m_pEditorLBnd, 2, 1); 612 } 613 614 /* Prepare upper bound label: */ 615 m_pLabelUBnd = new QLabel(this); 616 if (m_pLabelUBnd) 617 { 618 m_pLabelUBnd->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 619 pLayout->addWidget(m_pLabelUBnd, 3, 0); 620 } 621 /* Prepare upper bound editor: */ 622 m_pEditorUBnd = new QILineEdit(this); 623 if (m_pEditorUBnd) 624 { 625 m_pLabelUBnd->setBuddy(m_pEditorUBnd); 626 connect(m_pEditorUBnd, &QLineEdit::textChanged, 627 this, &UIDetailsWidgetHostNetwork::sltTextChangedUBnd); 628 629 pLayout->addWidget(m_pEditorUBnd, 3, 1); 630 } 631 632 /* If parent embedded into stack: */ 633 if (m_enmEmbedding == EmbedTo_Stack) 634 { 635 /* Prepare button-box: */ 636 m_pButtonBox = new QIDialogButtonBox(this); 637 if (m_pButtonBox) 638 { 639 m_pButtonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok); 640 connect(m_pButtonBox, &QIDialogButtonBox::clicked, this, &UIDetailsWidgetHostNetwork::sltHandleButtonBoxClick); 641 642 pLayout->addWidget(m_pButtonBox, 4, 0, 1, 2); 643 } 644 } 645 } 646 } 647 648 #else /* !VBOX_WS_MAC */ 382 649 383 650 void UIDetailsWidgetHostNetwork::prepareTabWidget() … … 762 1029 } 763 1030 } 1031 #endif /* !VBOX_WS_MAC */ 1032 1033 #ifdef VBOX_WS_MAC 1034 void UIDetailsWidgetHostNetwork::loadData() 1035 { 1036 /* Check whether network exists and configurable: */ 1037 const bool fIsNetworkExists = m_newData.m_fExists; 1038 1039 /* Toggle network fields availability: */ 1040 if (m_pLabelName) 1041 m_pLabelName->setEnabled(fIsNetworkExists); 1042 if (m_pEditorName) 1043 m_pEditorName->setEnabled(fIsNetworkExists); 1044 if (m_pLabelMask) 1045 m_pLabelMask->setEnabled(fIsNetworkExists); 1046 if (m_pEditorMask) 1047 m_pEditorMask->setEnabled(fIsNetworkExists); 1048 if (m_pLabelLBnd) 1049 m_pLabelLBnd->setEnabled(fIsNetworkExists); 1050 if (m_pEditorLBnd) 1051 m_pEditorLBnd->setEnabled(fIsNetworkExists); 1052 if (m_pLabelUBnd) 1053 m_pLabelUBnd->setEnabled(fIsNetworkExists); 1054 if (m_pEditorUBnd) 1055 m_pEditorUBnd->setEnabled(fIsNetworkExists); 1056 1057 /* Load network fields: */ 1058 if (m_pEditorName) 1059 m_pEditorName->setText(m_newData.m_strName); 1060 if (m_pEditorMask) 1061 m_pEditorMask->setText(m_newData.m_strMask); 1062 if (m_pEditorLBnd) 1063 m_pEditorLBnd->setText(m_newData.m_strLBnd); 1064 if (m_pEditorUBnd) 1065 m_pEditorUBnd->setText(m_newData.m_strUBnd); 1066 } 1067 1068 #else /* !VBOX_WS_MAC */ 764 1069 765 1070 void UIDetailsWidgetHostNetwork::loadDataForInterface() … … 876 1181 } 877 1182 } 1183 #endif /* !VBOX_WS_MAC */ -
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetHostNetwork.h
r92811 r92821 38 38 class QITabWidget; 39 39 40 41 #ifdef VBOX_WS_MAC 42 /** Network Manager: Host network data structure. */ 43 struct UIDataHostNetwork 44 { 45 /** Constructs data. */ 46 UIDataHostNetwork() 47 : m_fExists(false) 48 , m_strName(QString()) 49 , m_strMask(QString()) 50 , m_strLBnd(QString()) 51 , m_strUBnd(QString()) 52 {} 53 54 /** Returns whether the @a other passed data is equal to this one. */ 55 bool equal(const UIDataHostNetwork &other) const 56 { 57 return true 58 && (m_fExists == other.m_fExists) 59 && (m_strName == other.m_strName) 60 && (m_strMask == other.m_strMask) 61 && (m_strLBnd == other.m_strLBnd) 62 && (m_strUBnd == other.m_strUBnd) 63 ; 64 } 65 66 /** Returns whether the @a other passed data is equal to this one. */ 67 bool operator==(const UIDataHostNetwork &other) const { return equal(other); } 68 /** Returns whether the @a other passed data is different from this one. */ 69 bool operator!=(const UIDataHostNetwork &other) const { return !equal(other); } 70 71 /** Holds this interface is not NULL. */ 72 bool m_fExists; 73 /** Holds network name. */ 74 QString m_strName; 75 /** Holds network mask. */ 76 QString m_strMask; 77 /** Holds lower bound. */ 78 QString m_strLBnd; 79 /** Holds upper bound. */ 80 QString m_strUBnd; 81 }; 82 83 #else /* !VBOX_WS_MAC */ 40 84 41 85 /** Network Manager: Host Network Interface data structure. */ … … 161 205 UIDataDHCPServer m_dhcpserver; 162 206 }; 207 #endif /* !VBOX_WS_MAC */ 163 208 164 209 … … 186 231 /** Returns the host network data. */ 187 232 const UIDataHostNetwork &data() const { return m_newData; } 233 #ifdef VBOX_WS_MAC 234 /** Defines the host network @a data. 235 * @param busyNames Holds the list of names busy by other networks. */ 236 void setData(const UIDataHostNetwork &data, 237 const QStringList &busyNames = QStringList()); 238 #else /* !VBOX_WS_MAC */ 188 239 /** Defines the host network @a data. */ 189 240 void setData(const UIDataHostNetwork &data); 241 #endif /* !VBOX_WS_MAC */ 190 242 191 243 /** @name Change handling stuff. … … 207 259 /** @name Change handling stuff. 208 260 * @{ */ 261 #ifdef VBOX_WS_MAC 262 /** Handles network name text change. */ 263 void sltTextChangedName(const QString &strText); 264 /** Handles network mask text change. */ 265 void sltTextChangedMask(const QString &strText); 266 /** Handles network lower bound text change. */ 267 void sltTextChangedLBnd(const QString &strText); 268 /** Handles network upper bound text change. */ 269 void sltTextChangedUBnd(const QString &strText); 270 271 #else /* !VBOX_WS_MAC */ 272 209 273 /** Handles interface automatic configuration choice change. */ 210 274 void sltToggledButtonAutomatic(bool fChecked); … … 230 294 /** Handles DHCP server upper address text change. */ 231 295 void sltTextChangedUpperAddress(const QString &strText); 296 #endif /* !VBOX_WS_MAC */ 232 297 233 298 /** Handles button-box button click. */ … … 243 308 /** Prepares this. */ 244 309 void prepareThis(); 310 #ifdef VBOX_WS_MAC 311 /** Prepares options. */ 312 void prepareOptions(); 313 #else /* !VBOX_WS_MAC */ 245 314 /** Prepares tab-widget. */ 246 315 void prepareTabWidget(); … … 249 318 /** Prepares 'DHCP server' tab. */ 250 319 void prepareTabDHCPServer(); 320 #endif /* !VBOX_WS_MAC */ 251 321 /** @} */ 252 322 253 323 /** @name Loading stuff. 254 324 * @{ */ 325 #ifdef VBOX_WS_MAC 326 /** Loads data. */ 327 void loadData(); 328 #else /* !VBOX_WS_MAC */ 255 329 /** Loads interface data. */ 256 330 void loadDataForInterface(); 257 331 /** Loads server data. */ 258 332 void loadDataForDHCPServer(); 333 #endif /* !VBOX_WS_MAC */ 259 334 /** @} */ 260 335 … … 269 344 UIDataHostNetwork m_newData; 270 345 346 #ifndef VBOX_WS_MAC 271 347 /** Holds the tab-widget. */ 272 348 QITabWidget *m_pTabWidget; 273 /** @} */ 349 #endif /* !VBOX_WS_MAC */ 350 /** @} */ 351 352 #ifdef VBOX_WS_MAC 353 /** @name Network variables. 354 * @{ */ 355 /** Holds the name label. */ 356 QLabel *m_pLabelName; 357 /** Holds the name editor. */ 358 QILineEdit *m_pEditorName; 359 360 /** Holds the mask label. */ 361 QLabel *m_pLabelMask; 362 /** Holds the mask editor. */ 363 QILineEdit *m_pEditorMask; 364 365 /** Holds the lower bound label. */ 366 QLabel *m_pLabelLBnd; 367 /** Holds the lower bound editor. */ 368 QILineEdit *m_pEditorLBnd; 369 370 /** Holds the upper bound label. */ 371 QLabel *m_pLabelUBnd; 372 /** Holds the upper bound editor. */ 373 QILineEdit *m_pEditorUBnd; 374 375 /** Holds the button-box instance. */ 376 QIDialogButtonBox *m_pButtonBox; 377 378 /** Holds the list of names busy by other networks. */ 379 QStringList m_busyNames; 380 /** @} */ 381 382 #else /* !VBOX_WS_MAC */ 274 383 275 384 /** @name Interface variables. … … 333 442 QIDialogButtonBox *m_pButtonBoxServer; 334 443 /** @} */ 444 #endif /* !VBOX_WS_MAC */ 335 445 }; 336 446 -
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.cpp
r92811 r92821 47 47 #include "CDHCPServer.h" 48 48 #include "CHost.h" 49 #include "CHostNetworkInterface.h" 49 #ifdef VBOX_WS_MAC 50 # include "CHostOnlyNetwork.h" 51 #else 52 # include "CHostNetworkInterface.h" 53 #endif 50 54 #include "CNATNetwork.h" 51 55 … … 62 66 }; 63 67 68 69 #ifdef VBOX_WS_MAC 70 /** Host network tree-widget column indexes. */ 71 enum HostNetworkColumn 72 { 73 HostNetworkColumn_Name, 74 HostNetworkColumn_Mask, 75 HostNetworkColumn_LBnd, 76 HostNetworkColumn_UBnd, 77 HostNetworkColumn_Max, 78 }; 79 80 #else /* !VBOX_WS_MAC */ 64 81 65 82 /** Host network tree-widget column indexes. */ … … 72 89 HostNetworkColumn_Max, 73 90 }; 91 #endif /* !VBOX_WS_MAC */ 74 92 75 93 … … 105 123 void updateFields(); 106 124 125 #ifdef VBOX_WS_MAC 126 /** Returns item name. */ 127 QString name() const { return m_strName; } 128 #else 107 129 /** Returns item name. */ 108 130 QString name() const { return m_interface.m_strName; } 131 #endif 109 132 110 133 private: 111 134 135 #ifndef VBOX_WS_MAC 112 136 /** Returns CIDR for a passed @a strMask. */ 113 137 static int maskToCidr(const QString &strMask); 138 #endif 114 139 }; 115 140 … … 161 186 void UIItemHostNetwork::updateFields() 162 187 { 188 #ifdef VBOX_WS_MAC 189 /* Compose item fields: */ 190 setText(HostNetworkColumn_Name, m_strName); 191 setText(HostNetworkColumn_Mask, m_strMask); 192 setText(HostNetworkColumn_LBnd, m_strLBnd); 193 setText(HostNetworkColumn_UBnd, m_strUBnd); 194 195 /* Compose item tool-tip: */ 196 const QString strTable("<table cellspacing=5>%1</table>"); 197 const QString strHeader("<tr><td><nobr>%1: </nobr></td><td><nobr>%2</nobr></td></tr>"); 198 QString strToolTip; 199 200 /* Network information: */ 201 strToolTip += strHeader.arg(tr("Name"), m_strName); 202 strToolTip += strHeader.arg(tr("Mask"), m_strMask); 203 strToolTip += strHeader.arg(tr("Lower Bound"), m_strLBnd); 204 strToolTip += strHeader.arg(tr("Upper Bound"), m_strUBnd); 205 206 #else /* !VBOX_WS_MAC */ 207 163 208 /* Compose item fields: */ 164 209 setText(HostNetworkColumn_Name, m_interface.m_strName); … … 224 269 m_dhcpserver.m_strUpperAddress); 225 270 } 271 #endif /* !VBOX_WS_MAC */ 226 272 227 273 /* Assign tool-tip finally: */ … … 229 275 } 230 276 277 #ifndef VBOX_WS_MAC 231 278 /* static */ 232 279 int UIItemHostNetwork::maskToCidr(const QString &strMask) … … 259 306 return iCidr; 260 307 } 308 #endif /* !VBOX_WS_MAC */ 261 309 262 310 … … 387 435 if (m_pTreeWidgetHostNetwork) 388 436 { 437 #ifdef VBOX_WS_MAC 438 const QStringList fields = QStringList() 439 << UINetworkManager::tr("Name") 440 << UINetworkManager::tr("Mask") 441 << UINetworkManager::tr("Lower Bound") 442 << UINetworkManager::tr("Upper Bound"); 443 #else /* !VBOX_WS_MAC */ 389 444 const QStringList fields = QStringList() 390 445 << UINetworkManager::tr("Name") … … 392 447 << UINetworkManager::tr("IPv6 Prefix") 393 448 << UINetworkManager::tr("DHCP Server"); 449 #endif /* !VBOX_WS_MAC */ 394 450 m_pTreeWidgetHostNetwork->setHeaderLabels(fields); 395 451 } … … 471 527 return; 472 528 529 /* Check host network tree-widget: */ 530 AssertMsgReturnVoid(m_pTreeWidgetHostNetwork, ("Host network tree-widget isn't created!\n")); 531 532 #ifdef VBOX_WS_MAC 533 /* Compose a set of busy names: */ 534 QSet<QString> names; 535 for (int i = 0; i < m_pTreeWidgetHostNetwork->topLevelItemCount(); ++i) 536 names << qobject_cast<UIItemHostNetwork*>(m_pTreeWidgetHostNetwork->childItem(i))->name(); 537 /* Compose a map of busy indexes: */ 538 QMap<int, bool> presence; 539 const QString strNameTemplate("HostNetwork%1"); 540 const QRegExp regExp(strNameTemplate.arg("([\\d]*)")); 541 foreach (const QString &strName, names) 542 if (regExp.indexIn(strName) != -1) 543 presence[regExp.cap(1).toInt()] = true; 544 /* Search for a minimum index: */ 545 int iMinimumIndex = 0; 546 for (int i = 0; !presence.isEmpty() && i <= presence.lastKey() + 1; ++i) 547 if (!presence.contains(i)) 548 { 549 iMinimumIndex = i; 550 break; 551 } 552 /* Compose resulting index and name: */ 553 const QString strNetworkName = strNameTemplate.arg(iMinimumIndex == 0 ? QString() : QString::number(iMinimumIndex)); 554 555 /* Compose new item data: */ 556 UIDataHostNetwork oldData; 557 oldData.m_fExists = true; 558 oldData.m_strName = strNetworkName; 559 560 /* Get VirtualBox for further activities: */ 561 CVirtualBox comVBox = uiCommon().virtualBox(); 562 563 /* Create network: */ 564 CHostOnlyNetwork comNetwork = comVBox.CreateHostOnlyNetwork(oldData.m_strName); 565 CHostOnlyNetwork comNetworkBase = comNetwork; 566 567 /* Show error message if necessary: */ 568 if (!comVBox.isOk()) 569 UINotificationMessage::cannotCreateHostOnlyNetwork(comVBox); 570 else 571 { 572 /* Save host network name: */ 573 if (comNetwork.isOk()) 574 comNetwork.SetNetworkName(oldData.m_strName); 575 576 /* Show error message if necessary: */ 577 if (!comNetwork.isOk()) 578 UINotificationMessage::cannotChangeHostOnlyNetworkParameter(comNetwork); 579 580 /* Add network to the tree: */ 581 UIDataHostNetwork newData; 582 loadHostNetwork(comNetworkBase, newData); 583 createItemForHostNetwork(newData, true); 584 585 /* Adjust tree-widgets: */ 586 sltAdjustTreeWidgets(); 587 } 588 589 #else /* !VBOX_WS_MAC */ 590 473 591 /* Get host for further activities: */ 474 592 CHost comHost = uiCommon().host(); … … 481 599 this, &UINetworkManagerWidget::sigHandleHostOnlyNetworkInterfaceCreated); 482 600 gpNotificationCenter->append(pNotification); 483 } 484 601 #endif /* !VBOX_WS_MAC */ 602 } 603 604 #ifndef VBOX_WS_MAC 485 605 void UINetworkManagerWidget::sigHandleHostOnlyNetworkInterfaceCreated(const CHostNetworkInterface &comInterface) 486 606 { … … 514 634 } 515 635 } 636 #endif /* !VBOX_WS_MAC */ 516 637 517 638 void UINetworkManagerWidget::sltRemoveHostNetwork() … … 527 648 UIItemHostNetwork *pItem = static_cast<UIItemHostNetwork*>(m_pTreeWidgetHostNetwork->currentItem()); 528 649 AssertMsgReturnVoid(pItem, ("Current item must not be null!\n")); 650 651 #ifdef VBOX_WS_MAC 652 653 /* Get network name: */ 654 const QString strNetworkName(pItem->name()); 655 656 /* Confirm host network removal: */ 657 if (!msgCenter().confirmHostOnlyNetworkRemoval(strNetworkName, this)) 658 return; 659 660 /* Get VirtualBox for further activities: */ 661 CVirtualBox comVBox = uiCommon().virtualBox(); 662 663 /* Find corresponding network: */ 664 const CHostOnlyNetwork &comNetwork = comVBox.FindHostOnlyNetworkByName(strNetworkName); 665 666 /* Show error message if necessary: */ 667 if (!comVBox.isOk() || comNetwork.isNull()) 668 UINotificationMessage::cannotFindHostOnlyNetwork(comVBox, strNetworkName); 669 else 670 { 671 /* Remove network finally: */ 672 comVBox.RemoveHostOnlyNetwork(comNetwork); 673 674 /* Show error message if necessary: */ 675 if (!comVBox.isOk()) 676 UINotificationMessage::cannotRemoveHostOnlyNetwork(comVBox, strNetworkName); 677 else 678 { 679 /* Move selection to somewhere else: */ 680 if (m_pTreeWidgetHostNetwork->itemBelow(pItem)) 681 m_pTreeWidgetHostNetwork->setCurrentItem(m_pTreeWidgetHostNetwork->itemBelow(pItem)); 682 else if (m_pTreeWidgetHostNetwork->itemAbove(pItem)) 683 m_pTreeWidgetHostNetwork->setCurrentItem(m_pTreeWidgetHostNetwork->itemAbove(pItem)); 684 else 685 m_pTreeWidgetHostNetwork->setCurrentItem(0); 686 687 /* Remove interface from the tree: */ 688 delete pItem; 689 690 /* Adjust tree-widgets: */ 691 sltAdjustTreeWidgets(); 692 } 693 } 694 695 #else /* !VBOX_WS_MAC */ 529 696 530 697 /* Get interface name: */ … … 583 750 } 584 751 } 585 } 586 752 #endif /* !VBOX_WS_MAC */ 753 } 754 755 #ifndef VBOX_WS_MAC 587 756 void UINetworkManagerWidget::sigHandleHostOnlyNetworkInterfaceRemoved(const QString &strInterfaceName) 588 757 { … … 609 778 sltAdjustTreeWidgets(); 610 779 } 780 #endif /* !VBOX_WS_MAC */ 611 781 612 782 void UINetworkManagerWidget::sltCreateNATNetwork() … … 970 1140 /* Calculate the total tree-widget width: */ 971 1141 const int iTotal = m_pTreeWidgetHostNetwork->viewport()->width(); 1142 #ifdef VBOX_WS_MAC 1143 /* Look for a minimum width hints for non-important columns: */ 1144 const int iMinWidth1 = qMax(pItemView->sizeHintForColumn(HostNetworkColumn_Mask), pItemHeader->sectionSizeHint(HostNetworkColumn_Mask)); 1145 const int iMinWidth2 = qMax(pItemView->sizeHintForColumn(HostNetworkColumn_LBnd), pItemHeader->sectionSizeHint(HostNetworkColumn_LBnd)); 1146 const int iMinWidth3 = qMax(pItemView->sizeHintForColumn(HostNetworkColumn_UBnd), pItemHeader->sectionSizeHint(HostNetworkColumn_UBnd)); 1147 #else /* !VBOX_WS_MAC */ 972 1148 /* Look for a minimum width hints for non-important columns: */ 973 1149 const int iMinWidth1 = qMax(pItemView->sizeHintForColumn(HostNetworkColumn_IPv4), pItemHeader->sectionSizeHint(HostNetworkColumn_IPv4)); 974 1150 const int iMinWidth2 = qMax(pItemView->sizeHintForColumn(HostNetworkColumn_IPv6), pItemHeader->sectionSizeHint(HostNetworkColumn_IPv6)); 975 1151 const int iMinWidth3 = qMax(pItemView->sizeHintForColumn(HostNetworkColumn_DHCP), pItemHeader->sectionSizeHint(HostNetworkColumn_DHCP)); 1152 #endif /* !VBOX_WS_MAC */ 976 1153 /* Propose suitable width hints for non-important columns: */ 977 1154 const int iWidth1 = iMinWidth1 < iTotal / HostNetworkColumn_Max ? iMinWidth1 : iTotal / HostNetworkColumn_Max; … … 979 1156 const int iWidth3 = iMinWidth3 < iTotal / HostNetworkColumn_Max ? iMinWidth3 : iTotal / HostNetworkColumn_Max; 980 1157 /* Apply the proposal: */ 1158 #ifdef VBOX_WS_MAC 1159 m_pTreeWidgetHostNetwork->setColumnWidth(HostNetworkColumn_Mask, iWidth1); 1160 m_pTreeWidgetHostNetwork->setColumnWidth(HostNetworkColumn_LBnd, iWidth2); 1161 m_pTreeWidgetHostNetwork->setColumnWidth(HostNetworkColumn_UBnd, iWidth3); 1162 #else /* !VBOX_WS_MAC */ 981 1163 m_pTreeWidgetHostNetwork->setColumnWidth(HostNetworkColumn_IPv4, iWidth1); 982 1164 m_pTreeWidgetHostNetwork->setColumnWidth(HostNetworkColumn_IPv6, iWidth2); 983 1165 m_pTreeWidgetHostNetwork->setColumnWidth(HostNetworkColumn_DHCP, iWidth3); 1166 #endif /* !VBOX_WS_MAC */ 984 1167 m_pTreeWidgetHostNetwork->setColumnWidth(HostNetworkColumn_Name, iTotal - iWidth1 - iWidth2 - iWidth3); 985 1168 } … … 1094 1277 UIDataHostNetwork oldData = *pItem; 1095 1278 UIDataHostNetwork newData = m_pDetailsWidgetHostNetwork->data(); 1279 1280 #ifdef VBOX_WS_MAC 1281 /* Get VirtualBox for further activities: */ 1282 CVirtualBox comVBox = uiCommon().virtualBox(); 1283 1284 /* Find corresponding network: */ 1285 CHostOnlyNetwork comNetwork = comVBox.FindHostOnlyNetworkByName(oldData.m_strName); 1286 CHostOnlyNetwork comNetworkBase = comNetwork; 1287 1288 /* Show error message if necessary: */ 1289 if (!comVBox.isOk() || comNetwork.isNull()) 1290 UINotificationMessage::cannotFindHostOnlyNetwork(comVBox, oldData.m_strName); 1291 else 1292 { 1293 /* Save host network name: */ 1294 if (comNetwork.isOk() && newData.m_strName != oldData.m_strName) 1295 comNetwork.SetNetworkName(newData.m_strName); 1296 /* Save host network mask: */ 1297 if (comNetwork.isOk() && newData.m_strMask != oldData.m_strMask) 1298 comNetwork.SetNetworkMask(newData.m_strMask); 1299 /* Save host network lower bound: */ 1300 if (comNetwork.isOk() && newData.m_strLBnd != oldData.m_strLBnd) 1301 comNetwork.SetLowerIP(newData.m_strLBnd); 1302 /* Save host network upper bound: */ 1303 if (comNetwork.isOk() && newData.m_strUBnd != oldData.m_strUBnd) 1304 comNetwork.SetUpperIP(newData.m_strUBnd); 1305 1306 /* Show error message if necessary: */ 1307 if (!comNetwork.isOk()) 1308 UINotificationMessage::cannotChangeHostOnlyNetworkParameter(comNetwork); 1309 1310 /* Update network in the tree: */ 1311 UIDataHostNetwork data; 1312 loadHostNetwork(comNetworkBase, data); 1313 updateItemForHostNetwork(data, true, pItem); 1314 1315 /* Make sure current item fetched: */ 1316 sltHandleCurrentItemChangeHostNetwork(); 1317 1318 /* Adjust tree-widgets: */ 1319 sltAdjustTreeWidgets(); 1320 } 1321 1322 #else /* !VBOX_WS_MAC */ 1096 1323 1097 1324 /* Get host for further activities: */ … … 1203 1430 } 1204 1431 } 1432 #endif /* !VBOX_WS_MAC */ 1205 1433 } 1206 1434 … … 1817 2045 m_pTreeWidgetHostNetwork->clear(); 1818 2046 2047 #ifdef VBOX_WS_MAC 2048 /* Get VirtualBox for further activities: */ 2049 const CVirtualBox comVBox = uiCommon().virtualBox(); 2050 2051 /* Get networks for further activities: */ 2052 const QVector<CHostOnlyNetwork> networks = comVBox.GetHostOnlyNetworks(); 2053 2054 /* Show error message if necessary: */ 2055 if (!comVBox.isOk()) 2056 UINotificationMessage::cannotAcquireVirtualBoxParameter(comVBox); 2057 else 2058 { 2059 /* For each host network => load it to the tree: */ 2060 foreach (const CHostOnlyNetwork &comNetwork, networks) 2061 { 2062 UIDataHostNetwork data; 2063 loadHostNetwork(comNetwork, data); 2064 createItemForHostNetwork(data, false); 2065 } 2066 2067 /* Choose the 1st item as current initially: */ 2068 m_pTreeWidgetHostNetwork->setCurrentItem(m_pTreeWidgetHostNetwork->topLevelItem(0)); 2069 sltHandleCurrentItemChangeHostNetwork(); 2070 2071 /* Adjust tree-widgets: */ 2072 sltAdjustTreeWidgets(); 2073 } 2074 2075 #else /* !VBOX_WS_MAC */ 2076 1819 2077 /* Get host for further activities: */ 1820 2078 const CHost comHost = uiCommon().host(); … … 1844 2102 sltAdjustTreeWidgets(); 1845 2103 } 1846 } 2104 #endif /* !VBOX_WS_MAC */ 2105 } 2106 2107 #ifdef VBOX_WS_MAC 2108 void UINetworkManagerWidget::loadHostNetwork(const CHostOnlyNetwork &comNetwork, UIDataHostNetwork &data) 2109 { 2110 /* Gather network settings: */ 2111 if (comNetwork.isNotNull()) 2112 data.m_fExists = true; 2113 if (comNetwork.isOk()) 2114 data.m_strName = comNetwork.GetNetworkName(); 2115 if (comNetwork.isOk()) 2116 data.m_strMask = comNetwork.GetNetworkMask(); 2117 if (comNetwork.isOk()) 2118 data.m_strLBnd = comNetwork.GetLowerIP(); 2119 if (comNetwork.isOk()) 2120 data.m_strUBnd = comNetwork.GetUpperIP(); 2121 2122 /* Show error message if necessary: */ 2123 if (!comNetwork.isOk()) 2124 UINotificationMessage::cannotAcquireHostOnlyNetworkParameter(comNetwork); 2125 } 2126 2127 #else /* !VBOX_WS_MAC */ 1847 2128 1848 2129 void UINetworkManagerWidget::loadHostNetwork(const CHostNetworkInterface &comInterface, UIDataHostNetwork &data) … … 1905 2186 } 1906 2187 } 2188 #endif /* !VBOX_WS_MAC */ 1907 2189 1908 2190 void UINetworkManagerWidget::loadNATNetworks() … … 2199 2481 } 2200 2482 2483 #ifdef VBOX_WS_MAC 2484 QStringList UINetworkManagerWidget::busyNamesHost() const 2485 { 2486 QStringList names; 2487 for (int i = 0; i < m_pTreeWidgetHostNetwork->topLevelItemCount(); ++i) 2488 { 2489 UIItemHostNetwork *pItem = qobject_cast<UIItemHostNetwork*>(m_pTreeWidgetHostNetwork->childItem(i)); 2490 const QString strItemName(pItem->name()); 2491 if (!strItemName.isEmpty() && !names.contains(strItemName)) 2492 names << strItemName; 2493 } 2494 return names; 2495 } 2496 #endif /* VBOX_WS_MAC */ 2497 2201 2498 QStringList UINetworkManagerWidget::busyNamesNAT() const 2202 2499 { -
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.h
r92810 r92821 31 31 /* Forward declarations: */ 32 32 class CCloudNetwork; 33 #ifdef VBOX_WS_MAC 34 class CHostOnlyNetwork; 35 #else 33 36 class CHostNetworkInterface; 37 #endif 34 38 class CNATNetwork; 35 39 class QAbstractButton; … … 116 120 /** Handles command to create host network. */ 117 121 void sltCreateHostNetwork(); 122 #ifndef VBOX_WS_MAC 118 123 /** Handles signal about host network @a comInterface created. */ 119 124 void sigHandleHostOnlyNetworkInterfaceCreated(const CHostNetworkInterface &comInterface); 125 #endif 120 126 /** Handles command to remove host network. */ 121 127 void sltRemoveHostNetwork(); 128 #ifndef VBOX_WS_MAC 122 129 /** Handles signal about host network interface by the name of @a strInterfaceName was removed. */ 123 130 void sigHandleHostOnlyNetworkInterfaceRemoved(const QString &strInterfaceName); 131 #endif 124 132 125 133 /** Handles command to create NAT network. */ … … 211 219 /** Loads host networks. */ 212 220 void loadHostNetworks(); 221 #ifdef VBOX_WS_MAC 222 /** Loads host @a comNetwork data to passed @a data container. */ 223 void loadHostNetwork(const CHostOnlyNetwork &comNetwork, UIDataHostNetwork &data); 224 #else 213 225 /** Loads host @a comInterface data to passed @a data container. */ 214 226 void loadHostNetwork(const CHostNetworkInterface &comInterface, UIDataHostNetwork &data); 227 #endif 215 228 216 229 /** Loads NAT networks. */ … … 248 261 void updateItemForCloudNetwork(const UIDataCloudNetwork &data, bool fChooseItem, UIItemCloudNetwork *pItem); 249 262 263 #ifdef VBOX_WS_MAC 264 /** Returns a list of busy host network names. */ 265 QStringList busyNamesHost() const; 266 #endif 250 267 /** Returns a list of busy NAT network names. */ 251 268 QStringList busyNamesNAT() const; -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r92815 r92821 50 50 #include "CGraphicsAdapter.h" 51 51 #include "CHostNetworkInterface.h" 52 #include "CHostOnlyNetwork.h" 52 53 #include "CMediumAttachment.h" 53 54 #include "CNATNetwork.h" … … 688 689 689 690 /* static */ 691 void UINotificationMessage::cannotAcquireHostOnlyNetworkParameter(const CHostOnlyNetwork &comNetwork) 692 { 693 createMessage( 694 QApplication::translate("UIMessageCenter", "Host only network failure ..."), 695 QApplication::translate("UIMessageCenter", "Failed to acquire host only network parameter.") + 696 UIErrorString::formatErrorInfo(comNetwork)); 697 } 698 699 /* static */ 690 700 void UINotificationMessage::cannotAcquireNATNetworkParameter(const CNATNetwork &comNetwork) 691 701 { … … 832 842 QApplication::translate("UIMessageCenter", "Failed to change host network interface parameter.") + 833 843 UIErrorString::formatErrorInfo(comInterface)); 844 } 845 846 /* static */ 847 void UINotificationMessage::cannotChangeHostOnlyNetworkParameter(const CHostOnlyNetwork &comNetwork) 848 { 849 createMessage( 850 QApplication::translate("UIMessageCenter", "Host only network failure ..."), 851 QApplication::translate("UIMessageCenter", "Failed to change host only network parameter.") + 852 UIErrorString::formatErrorInfo(comNetwork)); 834 853 } 835 854 … … 1089 1108 1090 1109 /* static */ 1110 void UINotificationMessage::cannotFindHostOnlyNetwork(const CVirtualBox &comVBox, const QString &strNetworkName) 1111 { 1112 createMessage( 1113 QApplication::translate("UIMessageCenter", "Can't find host only network ..."), 1114 QApplication::translate("UIMessageCenter", "Unable to find the host only network <b>%1</b>.") 1115 .arg(strNetworkName) + 1116 UIErrorString::formatErrorInfo(comVBox)); 1117 } 1118 1119 /* static */ 1091 1120 void UINotificationMessage::cannotFindNATNetwork(const CVirtualBox &comVBox, const QString &strNetworkName) 1092 1121 { … … 1133 1162 QApplication::translate("UIMessageCenter", "Can't remove cloud network ..."), 1134 1163 QApplication::translate("UIMessageCenter", "Failed to remove the cloud network <b>%1</b>.") 1164 .arg(strNetworkName) + 1165 UIErrorString::formatErrorInfo(comVBox)); 1166 } 1167 1168 /* static */ 1169 void UINotificationMessage::cannotCreateHostOnlyNetwork(const CVirtualBox &comVBox) 1170 { 1171 createMessage( 1172 QApplication::translate("UIMessageCenter", "Can't create host only network ..."), 1173 QApplication::translate("UIMessageCenter", "Failed to create a host only network.") + 1174 UIErrorString::formatErrorInfo(comVBox)); 1175 } 1176 1177 /* static */ 1178 void UINotificationMessage::cannotRemoveHostOnlyNetwork(const CVirtualBox &comVBox, const QString &strNetworkName) 1179 { 1180 createMessage( 1181 QApplication::translate("UIMessageCenter", "Can't remove host only network ..."), 1182 QApplication::translate("UIMessageCenter", "Failed to remove the host only network <b>%1</b>.") 1135 1183 .arg(strNetworkName) + 1136 1184 UIErrorString::formatErrorInfo(comVBox)); -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r92815 r92821 291 291 * @param comInterface Brings the object parameter get acquired from. */ 292 292 static void cannotAcquireHostNetworkInterfaceParameter(const CHostNetworkInterface &comInterface); 293 /** Notifies about inability to acquire IHostOnlyNetwork parameter. 294 * @param comNetwork Brings the object parameter get acquired from. */ 295 static void cannotAcquireHostOnlyNetworkParameter(const CHostOnlyNetwork &comNetwork); 293 296 /** Notifies about inability to acquire INATNetwork parameter. 294 297 * @param comNetwork Brings the object parameter get acquired from. */ … … 342 345 * @param comInterface Brings the object parameter being changed for. */ 343 346 static void cannotChangeHostNetworkInterfaceParameter(const CHostNetworkInterface &comInterface); 347 /** Notifies about inability to change IHostOnlyNetwork parameter. 348 * @param comNetwork Brings the object parameter being changed for. */ 349 static void cannotChangeHostOnlyNetworkParameter(const CHostOnlyNetwork &comNetwork); 344 350 /** Notifies about inability to change INATNetwork parameter. 345 351 * @param comNetwork Brings the object parameter being changed for. */ … … 435 441 * @param strInterfaceName Brings interface name. */ 436 442 static void cannotFindHostNetworkInterface(const CHost &comHost, const QString &strInterfaceName); 443 /** Notifies about inability to find host only network. 444 * @param comVBox Brings the common VBox object being search through. 445 * @param strNetworkName Brings interface name. */ 446 static void cannotFindHostOnlyNetwork(const CVirtualBox &comVBox, const QString &strNetworkName); 437 447 /** Notifies about inability to find NAT network. 438 448 * @param comVBox Brings common VBox object being search through. … … 454 464 * @param strNetworkName Brings the network name. */ 455 465 static void cannotRemoveCloudNetwork(const CVirtualBox &comVBox, const QString &strNetworkName); 466 /** Notifies about inability to create host only network. 467 * @param comVBox Brings common VBox object trying to create host only network. */ 468 static void cannotCreateHostOnlyNetwork(const CVirtualBox &comVBox); 469 /** Notifies about inability to remove host only network. 470 * @param comVBox Brings common VBox object trying to remove host only network. 471 * @param strNetworkName Brings the network name. */ 472 static void cannotRemoveHostOnlyNetwork(const CVirtualBox &comVBox, const QString &strNetworkName); 456 473 /** Notifies about inability to create NAT network. 457 474 * @param comVBox Brings common VBox object trying to create NAT network. */
Note:
See TracChangeset
for help on using the changeset viewer.

