Changeset 87269 in vbox
- Timestamp:
- Jan 15, 2021 12:54:17 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetHostNetwork.cpp
r87268 r87269 56 56 , m_pButtonBoxServer(0) 57 57 { 58 /* Prepare: */59 58 prepare(); 60 59 } … … 273 272 { 274 273 /* Create layout: */ 275 QVBoxLayout *pLayout =new QVBoxLayout(this);276 if ( pLayout)274 new QVBoxLayout(this); 275 if (layout()) 277 276 { 278 277 /* Configure layout: */ 279 pLayout->setContentsMargins(0, 0, 0, 0);278 layout()->setContentsMargins(0, 0, 0, 0); 280 279 281 280 /* Prepare tab-widget: */ … … 287 286 { 288 287 /* Create tab-widget: */ 289 m_pTabWidget = new QITabWidget ;288 m_pTabWidget = new QITabWidget(this); 290 289 if (m_pTabWidget) 291 290 { … … 302 301 void UIDetailsWidgetHostNetwork::prepareTabInterface() 303 302 { 304 /* Create 'Interface' tab: */305 QWidget *pTabInterface = new QWidget ;303 /* Prepare 'Interface' tab: */ 304 QWidget *pTabInterface = new QWidget(m_pTabWidget); 306 305 if (pTabInterface) 307 306 { 308 /* Create 'Interface' layout: */307 /* Prepare 'Interface' layout: */ 309 308 QGridLayout *pLayoutInterface = new QGridLayout(pTabInterface); 310 309 if (pLayoutInterface) 311 310 { 312 311 #ifdef VBOX_WS_MAC 313 /* Configure layout: */314 312 pLayoutInterface->setSpacing(10); 315 313 pLayoutInterface->setContentsMargins(10, 10, 10, 10); … … 319 317 const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize); 320 318 321 /* Create automatic interface configuration layout: */319 /* Prepare automatic interface configuration layout: */ 322 320 QHBoxLayout *pLayoutAutomatic = new QHBoxLayout; 323 321 if (pLayoutAutomatic) 324 322 { 325 /* Configure layout: */326 323 pLayoutAutomatic->setContentsMargins(0, 0, 0, 0); 327 324 328 /* Create automatic interface configuration radio-button: */329 m_pButtonAutomatic = new QRadioButton ;325 /* Prepare automatic interface configuration radio-button: */ 326 m_pButtonAutomatic = new QRadioButton(pTabInterface); 330 327 if (m_pButtonAutomatic) 331 328 { 332 /* Configure radio-button: */333 329 connect(m_pButtonAutomatic, &QRadioButton::toggled, 334 330 this, &UIDetailsWidgetHostNetwork::sltToggledButtonAutomatic); 335 /* Add into layout: */336 331 pLayoutAutomatic->addWidget(m_pButtonAutomatic); 337 332 } 338 /* Create automatic interface configuration error pane: */339 m_pErrorPaneAutomatic = new QLabel ;333 /* Prepare automatic interface configuration error pane: */ 334 m_pErrorPaneAutomatic = new QLabel(pTabInterface); 340 335 if (m_pErrorPaneAutomatic) 341 336 { 342 /* Configure label: */343 337 m_pErrorPaneAutomatic->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); 344 338 m_pErrorPaneAutomatic->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); 345 339 m_pErrorPaneAutomatic->setPixmap(UIIconPool::iconSet(":/status_error_16px.png") 346 340 .pixmap(QSize(iIconMetric, iIconMetric))); 347 /* Add into layout: */ 341 348 342 pLayoutAutomatic->addWidget(m_pErrorPaneAutomatic); 349 343 } 350 /* Add into layout: */ 344 351 345 pLayoutInterface->addLayout(pLayoutAutomatic, 0, 0, 1, 3); 352 346 #ifdef VBOX_WS_MAC … … 355 349 } 356 350 357 /* Create manual interface configuration layout: */351 /* Prepare manual interface configuration layout: */ 358 352 QHBoxLayout *pLayoutManual = new QHBoxLayout; 359 353 if (pLayoutManual) 360 354 { 361 /* Configure layout: */362 355 pLayoutManual->setContentsMargins(0, 0, 0, 0); 363 /* Create manual interface configuration radio-button: */ 364 m_pButtonManual = new QRadioButton; 356 357 /* Prepare manual interface configuration radio-button: */ 358 m_pButtonManual = new QRadioButton(pTabInterface); 365 359 if (m_pButtonManual) 366 360 { 367 /* Configure radio-button: */368 361 connect(m_pButtonManual, &QRadioButton::toggled, 369 362 this, &UIDetailsWidgetHostNetwork::sltToggledButtonManual); 370 /* Add into layout: */371 363 pLayoutManual->addWidget(m_pButtonManual); 372 364 } 373 /* Create manual interface configuration error pane: */374 m_pErrorPaneManual = new QLabel ;365 /* Prepare manual interface configuration error pane: */ 366 m_pErrorPaneManual = new QLabel(pTabInterface); 375 367 if (m_pErrorPaneManual) 376 368 { 377 /* Configure label: */378 369 m_pErrorPaneManual->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); 379 370 m_pErrorPaneManual->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); 380 371 m_pErrorPaneManual->setPixmap(UIIconPool::iconSet(":/status_error_16px.png") 381 372 .pixmap(QSize(iIconMetric, iIconMetric))); 382 /* Add into layout: */ 373 383 374 pLayoutManual->addWidget(m_pErrorPaneManual); 384 375 } 385 /* Add into layout: */ 376 386 377 pLayoutInterface->addLayout(pLayoutManual, 1, 0, 1, 3); 387 378 #ifdef VBOX_WS_MAC … … 390 381 } 391 382 392 /* Create IPv4 address label: */393 m_pLabelIPv4 = new QLabel ;383 /* Prepare IPv4 address label: */ 384 m_pLabelIPv4 = new QLabel(pTabInterface); 394 385 if (m_pLabelIPv4) 395 386 { 396 /* Configure label: */397 387 m_pLabelIPv4->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter); 398 /* Add into layout: */399 388 pLayoutInterface->addWidget(m_pLabelIPv4, 2, 1); 400 389 } 401 /* Create IPv4 layout: */390 /* Prepare IPv4 layout: */ 402 391 QHBoxLayout *pLayoutIPv4 = new QHBoxLayout; 403 392 if (pLayoutIPv4) 404 393 { 405 /* Configure layout: */406 394 pLayoutIPv4->setContentsMargins(0, 0, 0, 0); 407 /* Create IPv4 address editor: */ 408 m_pEditorIPv4 = new QILineEdit; 395 396 /* Prepare IPv4 address editor: */ 397 m_pEditorIPv4 = new QILineEdit(pTabInterface); 409 398 if (m_pEditorIPv4) 410 399 { 411 /* Configure editor: */412 400 m_pLabelIPv4->setBuddy(m_pEditorIPv4); 413 401 connect(m_pEditorIPv4, &QLineEdit::textChanged, 414 402 this, &UIDetailsWidgetHostNetwork::sltTextChangedIPv4); 415 /* Add into layout: */ 403 416 404 pLayoutIPv4->addWidget(m_pEditorIPv4); 417 405 } 418 /* Create IPv4 error pane: */419 m_pErrorPaneIPv4 = new QLabel ;406 /* Prepare IPv4 error pane: */ 407 m_pErrorPaneIPv4 = new QLabel(pTabInterface); 420 408 if (m_pErrorPaneIPv4) 421 409 { 422 /* Configure label: */423 410 m_pErrorPaneIPv4->setAlignment(Qt::AlignCenter); 424 411 m_pErrorPaneIPv4->setPixmap(UIIconPool::iconSet(":/status_error_16px.png") 425 412 .pixmap(QSize(iIconMetric, iIconMetric))); 426 /* Add into layout: */ 413 427 414 pLayoutIPv4->addWidget(m_pErrorPaneIPv4); 428 415 } 429 /* Add into layout: */ 416 430 417 pLayoutInterface->addLayout(pLayoutIPv4, 2, 2); 431 418 } 432 419 433 /* Create NMv4 network mask label: */434 m_pLabelNMv4 = new QLabel ;420 /* Prepare NMv4 network mask label: */ 421 m_pLabelNMv4 = new QLabel(pTabInterface); 435 422 if (m_pLabelNMv4) 436 423 { 437 /* Configure label: */438 424 m_pLabelNMv4->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter); 439 /* Add into layout: */440 425 pLayoutInterface->addWidget(m_pLabelNMv4, 3, 1); 441 426 } 442 /* Create NMv4 layout: */427 /* Prepare NMv4 layout: */ 443 428 QHBoxLayout *pLayoutNMv4 = new QHBoxLayout; 444 429 if (pLayoutNMv4) 445 430 { 446 /* Configure layout: */447 431 pLayoutNMv4->setContentsMargins(0, 0, 0, 0); 448 /* Create NMv4 network mask editor: */ 449 m_pEditorNMv4 = new QILineEdit; 432 433 /* Prepare NMv4 network mask editor: */ 434 m_pEditorNMv4 = new QILineEdit(pTabInterface); 450 435 if (m_pEditorNMv4) 451 436 { 452 /* Configure editor: */453 437 m_pLabelNMv4->setBuddy(m_pEditorNMv4); 454 438 connect(m_pEditorNMv4, &QLineEdit::textChanged, 455 439 this, &UIDetailsWidgetHostNetwork::sltTextChangedNMv4); 456 /* Add into layout: */ 440 457 441 pLayoutNMv4->addWidget(m_pEditorNMv4); 458 442 } 459 /* Create NMv4 error pane: */460 m_pErrorPaneNMv4 = new QLabel ;443 /* Prepare NMv4 error pane: */ 444 m_pErrorPaneNMv4 = new QLabel(pTabInterface); 461 445 if (m_pErrorPaneNMv4) 462 446 { 463 /* Configure label: */464 447 m_pErrorPaneNMv4->setAlignment(Qt::AlignCenter); 465 448 m_pErrorPaneNMv4->setPixmap(UIIconPool::iconSet(":/status_error_16px.png") 466 449 .pixmap(QSize(iIconMetric, iIconMetric))); 467 /* Add into layout: */ 450 468 451 pLayoutNMv4->addWidget(m_pErrorPaneNMv4); 469 452 } 470 /* Add into layout: */ 453 471 454 pLayoutInterface->addLayout(pLayoutNMv4, 3, 2); 472 455 } 473 456 474 /* Create IPv6 address label: */475 m_pLabelIPv6 = new QLabel ;457 /* Prepare IPv6 address label: */ 458 m_pLabelIPv6 = new QLabel(pTabInterface); 476 459 if (m_pLabelIPv6) 477 460 { 478 /* Configure label: */479 461 m_pLabelIPv6->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter); 480 /* Add into layout: */481 462 pLayoutInterface->addWidget(m_pLabelIPv6, 4, 1); 482 463 } 483 /* Create IPv6 layout: */464 /* Prepare IPv6 layout: */ 484 465 QHBoxLayout *pLayoutIPv6 = new QHBoxLayout; 485 466 if (pLayoutIPv6) 486 467 { 487 /* Configure layout: */488 468 pLayoutIPv6->setContentsMargins(0, 0, 0, 0); 489 /* Create IPv6 address editor: */ 490 m_pEditorIPv6 = new QILineEdit; 469 470 /* Prepare IPv6 address editor: */ 471 m_pEditorIPv6 = new QILineEdit(pTabInterface); 491 472 if (m_pEditorIPv6) 492 473 { 493 /* Configure editor: */494 474 m_pLabelIPv6->setBuddy(m_pEditorIPv6); 495 475 connect(m_pEditorIPv6, &QLineEdit::textChanged, 496 476 this, &UIDetailsWidgetHostNetwork::sltTextChangedIPv6); 497 /* Add into layout: */ 477 498 478 pLayoutIPv6->addWidget(m_pEditorIPv6); 499 479 } 500 /* Create IPv4 error pane: */501 m_pErrorPaneIPv6 = new QLabel ;480 /* Prepare IPv4 error pane: */ 481 m_pErrorPaneIPv6 = new QLabel(pTabInterface); 502 482 if (m_pErrorPaneIPv6) 503 483 { 504 /* Configure label: */505 484 m_pErrorPaneIPv6->setAlignment(Qt::AlignCenter); 506 485 m_pErrorPaneIPv6->setPixmap(UIIconPool::iconSet(":/status_error_16px.png") 507 486 .pixmap(QSize(iIconMetric, iIconMetric))); 508 /* Add into layout: */ 487 509 488 pLayoutIPv6->addWidget(m_pErrorPaneIPv6); 510 489 } 511 /* Add into layout: */ 490 512 491 pLayoutInterface->addLayout(pLayoutIPv6, 4, 2); 513 492 } 514 493 515 /* Create NMv6 network mask label: */516 m_pLabelNMv6 = new QLabel ;494 /* Prepare NMv6 network mask label: */ 495 m_pLabelNMv6 = new QLabel(pTabInterface); 517 496 if (m_pLabelNMv6) 518 497 { 519 /* Configure label: */520 498 m_pLabelNMv6->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter); 521 /* Add into layout: */522 499 pLayoutInterface->addWidget(m_pLabelNMv6, 5, 1); 523 500 } 524 /* Create NMv6 layout: */501 /* Prepare NMv6 layout: */ 525 502 QHBoxLayout *pLayoutNMv6 = new QHBoxLayout; 526 503 if (pLayoutNMv6) 527 504 { 528 /* Configure layout: */529 505 pLayoutNMv6->setContentsMargins(0, 0, 0, 0); 530 /* Create NMv6 network mask editor: */ 531 m_pEditorNMv6 = new QILineEdit; 506 507 /* Prepare NMv6 network mask editor: */ 508 m_pEditorNMv6 = new QILineEdit(pTabInterface); 532 509 if (m_pEditorNMv6) 533 510 { 534 /* Configure editor: */535 511 m_pLabelNMv6->setBuddy(m_pEditorNMv6); 536 512 connect(m_pEditorNMv6, &QLineEdit::textChanged, 537 513 this, &UIDetailsWidgetHostNetwork::sltTextChangedNMv6); 538 /* Add into layout: */ 514 539 515 pLayoutNMv6->addWidget(m_pEditorNMv6); 540 516 } 541 /* Create NMv6 error pane: */542 m_pErrorPaneNMv6 = new QLabel ;517 /* Prepare NMv6 error pane: */ 518 m_pErrorPaneNMv6 = new QLabel(pTabInterface); 543 519 if (m_pErrorPaneNMv6) 544 520 { 545 /* Configure label: */546 521 m_pErrorPaneNMv6->setAlignment(Qt::AlignCenter); 547 522 m_pErrorPaneNMv6->setPixmap(UIIconPool::iconSet(":/status_error_16px.png") 548 523 .pixmap(QSize(iIconMetric, iIconMetric))); 549 /* Add into layout: */ 524 550 525 pLayoutNMv6->addWidget(m_pErrorPaneNMv6); 551 526 } 552 /* Add into layout: */ 527 553 528 pLayoutInterface->addLayout(pLayoutNMv6, 5, 2); 554 529 } 555 530 556 /* Create indent: */531 /* Prepare indent: */ 557 532 QStyleOption options; 558 533 options.initFrom(m_pButtonManual); … … 562 537 QSpacerItem *pSpacer1 = new QSpacerItem(iWidth, 0, QSizePolicy::Fixed, QSizePolicy::Expanding); 563 538 if (pSpacer1) 564 {565 /* Add into layout: */566 539 pLayoutInterface->addItem(pSpacer1, 2, 0, 4); 567 } 568 /* Create stretch: */ 540 /* Prepare stretch: */ 569 541 QSpacerItem *pSpacer2 = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); 570 542 if (pSpacer2) 571 {572 /* Add into layout: */573 543 pLayoutInterface->addItem(pSpacer2, 6, 0, 1, 3); 574 }575 544 576 545 /* If parent embedded into stack: */ 577 546 if (m_enmEmbedding == EmbedTo_Stack) 578 547 { 579 /* Create button-box: */580 m_pButtonBoxInterface = new QIDialogButtonBox ;548 /* Prepare button-box: */ 549 m_pButtonBoxInterface = new QIDialogButtonBox(pTabInterface); 581 550 if (m_pButtonBoxInterface) 582 551 { 583 /* Configure button-box: */584 552 m_pButtonBoxInterface->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok); 585 553 connect(m_pButtonBoxInterface, &QIDialogButtonBox::clicked, this, &UIDetailsWidgetHostNetwork::sltHandleButtonBoxClick); 586 554 587 /* Add into layout: */588 555 pLayoutInterface->addWidget(m_pButtonBoxInterface, 7, 0, 1, 3); 589 556 } 590 557 } 591 558 } 592 /* Add to tab-widget: */ 559 593 560 m_pTabWidget->addTab(pTabInterface, QString()); 594 561 } … … 597 564 void UIDetailsWidgetHostNetwork::prepareTabDHCPServer() 598 565 { 599 /* Create 'DHCP server' tab: */600 QWidget *pTabDHCPServer = new QWidget ;566 /* Prepare 'DHCP server' tab: */ 567 QWidget *pTabDHCPServer = new QWidget(m_pTabWidget); 601 568 if (pTabDHCPServer) 602 569 { 603 /* Create 'DHCP server' layout: */570 /* Prepare 'DHCP server' layout: */ 604 571 QGridLayout *pLayoutDHCPServer = new QGridLayout(pTabDHCPServer); 605 572 if (pLayoutDHCPServer) 606 573 { 607 574 #ifdef VBOX_WS_MAC 608 /* Configure layout: */609 575 pLayoutDHCPServer->setSpacing(10); 610 576 pLayoutDHCPServer->setContentsMargins(10, 10, 10, 10); … … 614 580 const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize); 615 581 616 /* Create DHCP server status check-box: */617 m_pCheckBoxDHCP = new QCheckBox ;582 /* Prepare DHCP server status check-box: */ 583 m_pCheckBoxDHCP = new QCheckBox(pTabDHCPServer); 618 584 if (m_pCheckBoxDHCP) 619 585 { 620 /* Configure check-box: */621 586 connect(m_pCheckBoxDHCP, &QCheckBox::stateChanged, 622 587 this, &UIDetailsWidgetHostNetwork::sltStatusChangedServer); 623 /* Add into layout: */624 588 pLayoutDHCPServer->addWidget(m_pCheckBoxDHCP, 0, 0, 1, 2); 625 589 #ifdef VBOX_WS_MAC … … 628 592 } 629 593 630 /* Create DHCP address label: */631 m_pLabelDHCPAddress = new QLabel ;594 /* Prepare DHCP address label: */ 595 m_pLabelDHCPAddress = new QLabel(pTabDHCPServer); 632 596 if (m_pLabelDHCPAddress) 633 597 { 634 /* Configure label: */635 598 m_pLabelDHCPAddress->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter); 636 /* Add into layout: */637 599 pLayoutDHCPServer->addWidget(m_pLabelDHCPAddress, 1, 1); 638 600 } 639 /* Create DHCP address layout: */601 /* Prepare DHCP address layout: */ 640 602 QHBoxLayout *pLayoutDHCPAddress = new QHBoxLayout; 641 603 if (pLayoutDHCPAddress) 642 604 { 643 /* Configure layout: */644 605 pLayoutDHCPAddress->setContentsMargins(0, 0, 0, 0); 645 /* Create DHCP address editor: */ 646 m_pEditorDHCPAddress = new QILineEdit; 606 607 /* Prepare DHCP address editor: */ 608 m_pEditorDHCPAddress = new QILineEdit(pTabDHCPServer); 647 609 if (m_pEditorDHCPAddress) 648 610 { 649 /* Configure editor: */650 611 m_pLabelDHCPAddress->setBuddy(m_pEditorDHCPAddress); 651 612 connect(m_pEditorDHCPAddress, &QLineEdit::textChanged, 652 613 this, &UIDetailsWidgetHostNetwork::sltTextChangedAddress); 653 /* Add into layout: */ 614 654 615 pLayoutDHCPAddress->addWidget(m_pEditorDHCPAddress); 655 616 } 656 /* Create DHCP address error pane: */657 m_pErrorPaneDHCPAddress = new QLabel ;617 /* Prepare DHCP address error pane: */ 618 m_pErrorPaneDHCPAddress = new QLabel(pTabDHCPServer); 658 619 if (m_pErrorPaneDHCPAddress) 659 620 { 660 /* Configure label: */661 621 m_pErrorPaneDHCPAddress->setAlignment(Qt::AlignCenter); 662 622 m_pErrorPaneDHCPAddress->setPixmap(UIIconPool::iconSet(":/status_error_16px.png") 663 623 .pixmap(QSize(iIconMetric, iIconMetric))); 664 /* Add into layout: */ 624 665 625 pLayoutDHCPAddress->addWidget(m_pErrorPaneDHCPAddress); 666 626 } 667 /* Add into layout: */ 627 668 628 pLayoutDHCPServer->addLayout(pLayoutDHCPAddress, 1, 2); 669 629 } 670 630 671 /* Create DHCP network mask label: */672 m_pLabelDHCPMask = new QLabel ;631 /* Prepare DHCP network mask label: */ 632 m_pLabelDHCPMask = new QLabel(pTabDHCPServer); 673 633 if (m_pLabelDHCPMask) 674 634 { 675 /* Configure label: */676 635 m_pLabelDHCPMask->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter); 677 /* Add into layout: */678 636 pLayoutDHCPServer->addWidget(m_pLabelDHCPMask, 2, 1); 679 637 } 680 /* Create DHCP mask layout: */638 /* Prepare DHCP mask layout: */ 681 639 QHBoxLayout *pLayoutDHCPMask = new QHBoxLayout; 682 640 if (pLayoutDHCPMask) 683 641 { 684 /* Configure layout: */685 642 pLayoutDHCPMask->setContentsMargins(0, 0, 0, 0); 686 /* Create DHCP network mask editor: */ 687 m_pEditorDHCPMask = new QILineEdit; 643 644 /* Prepare DHCP network mask editor: */ 645 m_pEditorDHCPMask = new QILineEdit(pTabDHCPServer); 688 646 if (m_pEditorDHCPMask) 689 647 { 690 /* Configure editor: */691 648 m_pLabelDHCPMask->setBuddy(m_pEditorDHCPMask); 692 649 connect(m_pEditorDHCPMask, &QLineEdit::textChanged, 693 650 this, &UIDetailsWidgetHostNetwork::sltTextChangedMask); 694 /* Add into layout: */ 651 695 652 pLayoutDHCPMask->addWidget(m_pEditorDHCPMask); 696 653 } 697 /* Create DHCP mask error pane: */698 m_pErrorPaneDHCPMask = new QLabel ;654 /* Prepare DHCP mask error pane: */ 655 m_pErrorPaneDHCPMask = new QLabel(pTabDHCPServer); 699 656 if (m_pErrorPaneDHCPMask) 700 657 { 701 /* Configure label: */702 658 m_pErrorPaneDHCPMask->setAlignment(Qt::AlignCenter); 703 659 m_pErrorPaneDHCPMask->setPixmap(UIIconPool::iconSet(":/status_error_16px.png") 704 660 .pixmap(QSize(iIconMetric, iIconMetric))); 705 /* Add into layout: */ 661 706 662 pLayoutDHCPMask->addWidget(m_pErrorPaneDHCPMask); 707 663 } 708 /* Add into layout: */ 664 709 665 pLayoutDHCPServer->addLayout(pLayoutDHCPMask, 2, 2); 710 666 } 711 667 712 /* Create DHCP lower address label: */713 m_pLabelDHCPLowerAddress = new QLabel ;668 /* Prepare DHCP lower address label: */ 669 m_pLabelDHCPLowerAddress = new QLabel(pTabDHCPServer); 714 670 if (m_pLabelDHCPLowerAddress) 715 671 { 716 /* Configure label: */717 672 m_pLabelDHCPLowerAddress->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter); 718 /* Add into layout: */719 673 pLayoutDHCPServer->addWidget(m_pLabelDHCPLowerAddress, 3, 1); 720 674 } 721 /* Create DHCP lower address layout: */675 /* Prepare DHCP lower address layout: */ 722 676 QHBoxLayout *pLayoutDHCPLowerAddress = new QHBoxLayout; 723 677 if (pLayoutDHCPLowerAddress) 724 678 { 725 /* Configure layout: */726 679 pLayoutDHCPLowerAddress->setContentsMargins(0, 0, 0, 0); 727 /* Create DHCP lower address editor: */ 728 m_pEditorDHCPLowerAddress = new QILineEdit; 680 681 /* Prepare DHCP lower address editor: */ 682 m_pEditorDHCPLowerAddress = new QILineEdit(pTabDHCPServer); 729 683 if (m_pEditorDHCPLowerAddress) 730 684 { 731 /* Configure editor: */732 685 m_pLabelDHCPLowerAddress->setBuddy(m_pEditorDHCPLowerAddress); 733 686 connect(m_pEditorDHCPLowerAddress, &QLineEdit::textChanged, 734 687 this, &UIDetailsWidgetHostNetwork::sltTextChangedLowerAddress); 735 /* Add into layout: */ 688 736 689 pLayoutDHCPLowerAddress->addWidget(m_pEditorDHCPLowerAddress); 737 690 } 738 /* Create DHCP lower address error pane: */739 m_pErrorPaneDHCPLowerAddress = new QLabel ;691 /* Prepare DHCP lower address error pane: */ 692 m_pErrorPaneDHCPLowerAddress = new QLabel(pTabDHCPServer); 740 693 if (m_pErrorPaneDHCPLowerAddress) 741 694 { 742 /* Configure label: */743 695 m_pErrorPaneDHCPLowerAddress->setAlignment(Qt::AlignCenter); 744 696 m_pErrorPaneDHCPLowerAddress->setPixmap(UIIconPool::iconSet(":/status_error_16px.png") 745 697 .pixmap(QSize(iIconMetric, iIconMetric))); 746 /* Add into layout: */ 698 747 699 pLayoutDHCPLowerAddress->addWidget(m_pErrorPaneDHCPLowerAddress); 748 700 } 749 /* Add into layout: */ 701 750 702 pLayoutDHCPServer->addLayout(pLayoutDHCPLowerAddress, 3, 2); 751 703 } 752 704 753 /* Create DHCP upper address label: */754 m_pLabelDHCPUpperAddress = new QLabel ;705 /* Prepare DHCP upper address label: */ 706 m_pLabelDHCPUpperAddress = new QLabel(pTabDHCPServer); 755 707 if (m_pLabelDHCPUpperAddress) 756 708 { 757 /* Configure label: */758 709 m_pLabelDHCPUpperAddress->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter); 759 /* Add into layout: */760 710 pLayoutDHCPServer->addWidget(m_pLabelDHCPUpperAddress, 4, 1); 761 711 } 762 /* Create DHCP upper address layout: */712 /* Prepare DHCP upper address layout: */ 763 713 QHBoxLayout *pLayoutDHCPUpperAddress = new QHBoxLayout; 764 714 if (pLayoutDHCPUpperAddress) 765 715 { 766 /* Configure layout: */767 716 pLayoutDHCPUpperAddress->setContentsMargins(0, 0, 0, 0); 768 /* Create DHCP upper address editor: */ 769 m_pEditorDHCPUpperAddress = new QILineEdit; 717 718 /* Prepare DHCP upper address editor: */ 719 m_pEditorDHCPUpperAddress = new QILineEdit(pTabDHCPServer); 770 720 if (m_pEditorDHCPUpperAddress) 771 721 { 772 /* Configure editor: */773 722 m_pLabelDHCPUpperAddress->setBuddy(m_pEditorDHCPUpperAddress); 774 723 connect(m_pEditorDHCPUpperAddress, &QLineEdit::textChanged, 775 724 this, &UIDetailsWidgetHostNetwork::sltTextChangedUpperAddress); 776 /* Add into layout: */ 725 777 726 pLayoutDHCPUpperAddress->addWidget(m_pEditorDHCPUpperAddress); 778 727 } 779 /* Create DHCP upper address error pane: */780 m_pErrorPaneDHCPUpperAddress = new QLabel ;728 /* Prepare DHCP upper address error pane: */ 729 m_pErrorPaneDHCPUpperAddress = new QLabel(pTabDHCPServer); 781 730 if (m_pErrorPaneDHCPUpperAddress) 782 731 { 783 /* Configure label: */784 732 m_pErrorPaneDHCPUpperAddress->setAlignment(Qt::AlignCenter); 785 733 m_pErrorPaneDHCPUpperAddress->setPixmap(UIIconPool::iconSet(":/status_error_16px.png") 786 734 .pixmap(QSize(iIconMetric, iIconMetric))); 787 /* Add into layout: */ 735 788 736 pLayoutDHCPUpperAddress->addWidget(m_pErrorPaneDHCPUpperAddress); 789 737 } 790 /* Add into layout: */ 738 791 739 pLayoutDHCPServer->addLayout(pLayoutDHCPUpperAddress, 4, 2); 792 740 } 793 741 794 /* Create indent: */742 /* Prepare indent: */ 795 743 QStyleOption options; 796 744 options.initFrom(m_pCheckBoxDHCP); … … 800 748 QSpacerItem *pSpacer1 = new QSpacerItem(iWidth, 0, QSizePolicy::Fixed, QSizePolicy::Expanding); 801 749 if (pSpacer1) 802 {803 /* Add into layout: */804 750 pLayoutDHCPServer->addItem(pSpacer1, 1, 0, 4); 805 } 806 /* Create stretch: */ 751 /* Prepare stretch: */ 807 752 QSpacerItem *pSpacer2 = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); 808 753 if (pSpacer2) 809 {810 /* Add into layout: */811 754 pLayoutDHCPServer->addItem(pSpacer2, 5, 0, 1, 3); 812 }813 755 814 756 /* If parent embedded into stack: */ 815 757 if (m_enmEmbedding == EmbedTo_Stack) 816 758 { 817 /* Create button-box: */818 m_pButtonBoxServer = new QIDialogButtonBox ;759 /* Prepare button-box: */ 760 m_pButtonBoxServer = new QIDialogButtonBox(pTabDHCPServer); 819 761 if (m_pButtonBoxServer) 820 762 { 821 /* Configure button-box: */822 763 m_pButtonBoxServer->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok); 823 764 connect(m_pButtonBoxServer, &QIDialogButtonBox::clicked, this, &UIDetailsWidgetHostNetwork::sltHandleButtonBoxClick); 824 765 825 /* Add into layout: */826 766 pLayoutDHCPServer->addWidget(m_pButtonBoxServer, 6, 0, 1, 3); 827 767 } 828 768 } 829 769 } 830 /* Add to tab-widget: */ 770 831 771 m_pTabWidget->addTab(pTabDHCPServer, QString()); 832 772 }
Note:
See TracChangeset
for help on using the changeset viewer.