Changeset 36323 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Mar 21, 2011 12:13:16 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.cpp
r36127 r36323 6 6 7 7 /* 8 * Copyright (C) 2006-201 0Oracle Corporation8 * Copyright (C) 2006-2011 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 595 595 CSystemProperties props = vboxGlobal().virtualBox().GetSystemProperties(); 596 596 597 UISettingsDialog *dlg = new UI GLSettingsDlg(this);597 UISettingsDialog *dlg = new UISettingsDialogGlobal(this); 598 598 dlg->getFrom(); 599 599 … … 737 737 mDoneInaccessibleWarningOnce = true; 738 738 739 UISettingsDialog *dlg = new UI VMSettingsDlg(this, m, strCategory, strControl);739 UISettingsDialog *dlg = new UISettingsDialogMachine(this, m, strCategory, strControl); 740 740 dlg->getFrom(); 741 741 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp
r35132 r36323 7 7 8 8 /* 9 * Copyright (C) 2006-201 0Oracle Corporation9 * Copyright (C) 2006-2011 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 42 42 43 43 /* Settings Dialog Constructor: */ 44 UISettingsDialog::UISettingsDialog(QWidget *pParent /* = 0 */)44 UISettingsDialog::UISettingsDialog(QWidget *pParent) 45 45 /* Parent class: */ 46 46 : QIWithRetranslateUI<QIMainDialog>(pParent) -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h
r35131 r36323 6 6 7 7 /* 8 * Copyright (C) 2006-201 0Oracle Corporation8 * Copyright (C) 2006-2011 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 41 41 42 42 /* Settings Dialog Constructor/Destructor: */ 43 UISettingsDialog(QWidget *pParent = 0);43 UISettingsDialog(QWidget *pParent); 44 44 ~UISettingsDialog(); 45 45 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r35131 r36323 7 7 8 8 /* 9 * Copyright (C) 2006-201 0Oracle Corporation9 * Copyright (C) 2006-2011 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 288 288 UISettingsSerializer* UISettingsSerializer::m_pInstance = 0; 289 289 290 UI GLSettingsDlg::UIGLSettingsDlg(QWidget *pParent)290 UISettingsDialogGlobal::UISettingsDialogGlobal(QWidget *pParent) 291 291 : UISettingsDialog(pParent) 292 292 { … … 297 297 298 298 /* Creating settings pages: */ 299 for (int i = GLSettingsPage_General; i < GLSettingsPage_MAX; ++i) 300 { 301 if (isAvailable(i)) 302 { 303 switch (i) 299 for (int iPageIndex = GLSettingsPage_General; iPageIndex < GLSettingsPage_MAX; ++iPageIndex) 300 { 301 if (isAvailable(iPageIndex)) 302 { 303 UISettingsPage *pSettingsPage = 0; 304 switch (iPageIndex) 304 305 { 305 306 /* General page: */ 306 307 case GLSettingsPage_General: 307 308 { 308 UISettingsPage *pSettingsPage = new UIGlobalSettingsGeneral; 309 pSettingsPage->setId(i); 309 pSettingsPage = new UIGlobalSettingsGeneral; 310 310 addItem(":/machine_32px.png", ":/machine_disabled_32px.png", 311 311 ":/machine_16px.png", ":/machine_disabled_16px.png", 312 i , "#general", pSettingsPage);312 iPageIndex, "#general", pSettingsPage); 313 313 break; 314 314 } … … 316 316 case GLSettingsPage_Input: 317 317 { 318 UISettingsPage *pSettingsPage = new UIGlobalSettingsInput; 319 pSettingsPage->setId(i); 318 pSettingsPage = new UIGlobalSettingsInput; 320 319 addItem(":/hostkey_32px.png", ":/hostkey_disabled_32px.png", 321 320 ":/hostkey_16px.png", ":/hostkey_disabled_16px.png", 322 i , "#input", pSettingsPage);321 iPageIndex, "#input", pSettingsPage); 323 322 break; 324 323 } … … 326 325 case GLSettingsPage_Update: 327 326 { 328 UISettingsPage *pSettingsPage = new UIGlobalSettingsUpdate; 329 pSettingsPage->setId(i); 327 pSettingsPage = new UIGlobalSettingsUpdate; 330 328 addItem(":/refresh_32px.png", ":/refresh_disabled_32px.png", 331 329 ":/refresh_16px.png", ":/refresh_disabled_16px.png", 332 i , "#update", pSettingsPage);330 iPageIndex, "#update", pSettingsPage); 333 331 break; 334 332 } … … 336 334 case GLSettingsPage_Language: 337 335 { 338 UISettingsPage *pSettingsPage = new UIGlobalSettingsLanguage; 339 pSettingsPage->setId(i); 336 pSettingsPage = new UIGlobalSettingsLanguage; 340 337 addItem(":/site_32px.png", ":/site_disabled_32px.png", 341 338 ":/site_16px.png", ":/site_disabled_16px.png", 342 i , "#language", pSettingsPage);339 iPageIndex, "#language", pSettingsPage); 343 340 break; 344 341 } … … 346 343 case GLSettingsPage_USB: 347 344 { 348 UISettingsPage *pSettingsPage = new UIMachineSettingsUSB(UISettingsPageType_Global); 349 pSettingsPage->setId(i); 345 pSettingsPage = new UIMachineSettingsUSB(UISettingsPageType_Global); 350 346 addItem(":/usb_32px.png", ":/usb_disabled_32px.png", 351 347 ":/usb_16px.png", ":/usb_disabled_16px.png", 352 i , "#usb", pSettingsPage);348 iPageIndex, "#usb", pSettingsPage); 353 349 break; 354 350 } … … 356 352 case GLSettingsPage_Network: 357 353 { 358 UISettingsPage *pSettingsPage = new UIGlobalSettingsNetwork; 359 pSettingsPage->setId(i); 354 pSettingsPage = new UIGlobalSettingsNetwork; 360 355 addItem(":/nw_32px.png", ":/nw_disabled_32px.png", 361 356 ":/nw_16px.png", ":/nw_disabled_16px.png", 362 i , "#language", pSettingsPage);357 iPageIndex, "#language", pSettingsPage); 363 358 break; 364 359 } … … 366 361 case GLSettingsPage_Extension: 367 362 { 368 UISettingsPage *pSettingsPage = new UIGlobalSettingsExtension; 369 pSettingsPage->setId(i); 363 pSettingsPage = new UIGlobalSettingsExtension; 370 364 addItem(":/extension_pack_32px.png", ":/extension_pack_disabled_32px.png", 371 365 ":/extension_pack_16px.png", ":/extension_pack_disabled_16px.png", 372 i , "#extension", pSettingsPage);366 iPageIndex, "#extension", pSettingsPage); 373 367 break; 374 368 } … … 376 370 break; 377 371 } 372 if (pSettingsPage) 373 pSettingsPage->setId(iPageIndex); 378 374 } 379 375 } … … 386 382 } 387 383 388 void UI GLSettingsDlg::getFrom()384 void UISettingsDialogGlobal::getFrom() 389 385 { 390 386 /* Prepare global data: */ … … 403 399 } 404 400 405 void UI GLSettingsDlg::putBackTo()401 void UISettingsDialogGlobal::putBackTo() 406 402 { 407 403 /* Get properties and settings: */ … … 432 428 } 433 429 434 void UI GLSettingsDlg::retranslateUi()430 void UISettingsDialogGlobal::retranslateUi() 435 431 { 436 432 /* Set dialog's name: */ … … 465 461 } 466 462 467 QString UI GLSettingsDlg::title() const463 QString UISettingsDialogGlobal::title() const 468 464 { 469 465 return tr("VirtualBox - %1").arg(titleExtension()); 470 466 } 471 467 472 bool UI GLSettingsDlg::isAvailable(int id)468 bool UISettingsDialogGlobal::isAvailable(int id) 473 469 { 474 470 /* Show the host error message for particular group if present. … … 508 504 } 509 505 510 UI VMSettingsDlg::UIVMSettingsDlg(QWidget *pParent,511 const CMachine &machine,512 const QString &strCategory,513 const QString &strControl)506 UISettingsDialogMachine::UISettingsDialogMachine(QWidget *pParent, 507 const CMachine &machine, 508 const QString &strCategory, 509 const QString &strControl) 514 510 : UISettingsDialog(pParent) 515 511 , m_machine(machine) … … 526 522 527 523 /* Creating settings pages: */ 528 for (int i = VMSettingsPage_General; i < VMSettingsPage_MAX; ++i) 529 { 530 if (isAvailable(i)) 531 { 532 switch (i) 524 for (int iPageIndex = VMSettingsPage_General; iPageIndex < VMSettingsPage_MAX; ++iPageIndex) 525 { 526 if (isAvailable(iPageIndex)) 527 { 528 UISettingsPage *pSettingsPage = 0; 529 switch (iPageIndex) 533 530 { 534 531 /* General page: */ 535 532 case VMSettingsPage_General: 536 533 { 537 UISettingsPage *pSettingsPage = new UIMachineSettingsGeneral; 538 pSettingsPage->setId(i); 534 pSettingsPage = new UIMachineSettingsGeneral; 539 535 addItem(":/machine_32px.png", ":/machine_disabled_32px.png", 540 536 ":/machine_16px.png", ":/machine_disabled_16px.png", 541 i , "#general", pSettingsPage);537 iPageIndex, "#general", pSettingsPage); 542 538 break; 543 539 } … … 545 541 case VMSettingsPage_System: 546 542 { 547 UISettingsPage *pSettingsPage = new UIMachineSettingsSystem; 548 pSettingsPage->setId(i); 543 pSettingsPage = new UIMachineSettingsSystem; 549 544 connect(pSettingsPage, SIGNAL(tableChanged()), this, SLOT(sltResetFirstRunFlag())); 550 545 addItem(":/chipset_32px.png", ":/chipset_disabled_32px.png", 551 546 ":/chipset_16px.png", ":/chipset_disabled_16px.png", 552 i , "#system", pSettingsPage);547 iPageIndex, "#system", pSettingsPage); 553 548 break; 554 549 } … … 556 551 case VMSettingsPage_Display: 557 552 { 558 UISettingsPage *pSettingsPage = new UIMachineSettingsDisplay; 559 pSettingsPage->setId(i); 553 pSettingsPage = new UIMachineSettingsDisplay; 560 554 addItem(":/vrdp_32px.png", ":/vrdp_disabled_32px.png", 561 555 ":/vrdp_16px.png", ":/vrdp_disabled_16px.png", 562 i , "#display", pSettingsPage);556 iPageIndex, "#display", pSettingsPage); 563 557 break; 564 558 } … … 566 560 case VMSettingsPage_Storage: 567 561 { 568 UISettingsPage *pSettingsPage = new UIMachineSettingsStorage; 569 pSettingsPage->setId(i); 562 pSettingsPage = new UIMachineSettingsStorage; 570 563 connect(pSettingsPage, SIGNAL(storageChanged()), this, SLOT(sltResetFirstRunFlag())); 571 564 addItem(":/hd_32px.png", ":/hd_disabled_32px.png", 572 565 ":/attachment_16px.png", ":/attachment_disabled_16px.png", 573 i , "#storage", pSettingsPage);566 iPageIndex, "#storage", pSettingsPage); 574 567 break; 575 568 } … … 577 570 case VMSettingsPage_Audio: 578 571 { 579 UISettingsPage *pSettingsPage = new UIMachineSettingsAudio; 580 pSettingsPage->setId(i); 572 pSettingsPage = new UIMachineSettingsAudio; 581 573 addItem(":/sound_32px.png", ":/sound_disabled_32px.png", 582 574 ":/sound_16px.png", ":/sound_disabled_16px.png", 583 i , "#audio", pSettingsPage);575 iPageIndex, "#audio", pSettingsPage); 584 576 break; 585 577 } … … 587 579 case VMSettingsPage_Network: 588 580 { 589 UISettingsPage *pSettingsPage = new UIMachineSettingsNetworkPage; 590 pSettingsPage->setId(i); 581 pSettingsPage = new UIMachineSettingsNetworkPage; 591 582 addItem(":/nw_32px.png", ":/nw_disabled_32px.png", 592 583 ":/nw_16px.png", ":/nw_disabled_16px.png", 593 i , "#network", pSettingsPage);584 iPageIndex, "#network", pSettingsPage); 594 585 break; 595 586 } … … 599 590 addItem(":/serial_port_32px.png", ":/serial_port_disabled_32px.png", 600 591 ":/serial_port_16px.png", ":/serial_port_disabled_16px.png", 601 i , "#ports");592 iPageIndex, "#ports"); 602 593 break; 603 594 } … … 605 596 case VMSettingsPage_Serial: 606 597 { 607 UISettingsPage *pSettingsPage = new UIMachineSettingsSerialPage; 608 pSettingsPage->setId(i); 598 pSettingsPage = new UIMachineSettingsSerialPage; 609 599 addItem(":/serial_port_32px.png", ":/serial_port_disabled_32px.png", 610 600 ":/serial_port_16px.png", ":/serial_port_disabled_16px.png", 611 i , "#serialPorts", pSettingsPage, VMSettingsPage_Ports);601 iPageIndex, "#serialPorts", pSettingsPage, VMSettingsPage_Ports); 612 602 break; 613 603 } … … 615 605 case VMSettingsPage_Parallel: 616 606 { 617 UISettingsPage *pSettingsPage = new UIMachineSettingsParallelPage; 618 pSettingsPage->setId(i); 607 pSettingsPage = new UIMachineSettingsParallelPage; 619 608 addItem(":/parallel_port_32px.png", ":/parallel_port_disabled_32px.png", 620 609 ":/parallel_port_16px.png", ":/parallel_port_disabled_16px.png", 621 i , "#parallelPorts", pSettingsPage, VMSettingsPage_Ports);610 iPageIndex, "#parallelPorts", pSettingsPage, VMSettingsPage_Ports); 622 611 break; 623 612 } … … 625 614 case VMSettingsPage_USB: 626 615 { 627 UISettingsPage *pSettingsPage = new UIMachineSettingsUSB(UISettingsPageType_Machine); 628 pSettingsPage->setId(i); 616 pSettingsPage = new UIMachineSettingsUSB(UISettingsPageType_Machine); 629 617 addItem(":/usb_32px.png", ":/usb_disabled_32px.png", 630 618 ":/usb_16px.png", ":/usb_disabled_16px.png", 631 i , "#usb", pSettingsPage, VMSettingsPage_Ports);619 iPageIndex, "#usb", pSettingsPage, VMSettingsPage_Ports); 632 620 break; 633 621 } … … 635 623 case VMSettingsPage_SF: 636 624 { 637 UISettingsPage *pSettingsPage = new UIMachineSettingsSF; 638 pSettingsPage->setId(i); 625 pSettingsPage = new UIMachineSettingsSF; 639 626 addItem(":/shared_folder_32px.png", ":/shared_folder_disabled_32px.png", 640 627 ":/shared_folder_16px.png", ":/shared_folder_disabled_16px.png", 641 i , "#sfolders", pSettingsPage);628 iPageIndex, "#sfolders", pSettingsPage); 642 629 break; 643 630 } … … 645 632 break; 646 633 } 634 if (pSettingsPage) 635 pSettingsPage->setId(iPageIndex); 647 636 } 648 637 } … … 685 674 } 686 675 687 void UI VMSettingsDlg::getFrom()676 void UISettingsDialogMachine::getFrom() 688 677 { 689 678 /* Prepare machine data: */ … … 705 694 } 706 695 707 void UI VMSettingsDlg::putBackTo()696 void UISettingsDialogMachine::putBackTo() 708 697 { 709 698 /* Prepare machine data: */ … … 768 757 } 769 758 770 void UI VMSettingsDlg::retranslateUi()759 void UISettingsDialogMachine::retranslateUi() 771 760 { 772 761 /* Set dialog's name: */ … … 833 822 } 834 823 835 QString UI VMSettingsDlg::title() const824 QString UISettingsDialogMachine::title() const 836 825 { 837 826 QString strDialogTitle; … … 841 830 } 842 831 843 bool UI VMSettingsDlg::recorrelate(QWidget *pPage, QString &strWarning)832 bool UISettingsDialogMachine::recorrelate(QWidget *pPage, QString &strWarning) 844 833 { 845 834 /* This method performs correlation option check … … 960 949 } 961 950 962 void UI VMSettingsDlg::sltCategoryChanged(int cId)951 void UISettingsDialogMachine::sltCategoryChanged(int cId) 963 952 { 964 953 if (UISettingsSerializer::instance()) … … 968 957 } 969 958 970 void UI VMSettingsDlg::sltAllowResetFirstRunFlag()959 void UISettingsDialogMachine::sltAllowResetFirstRunFlag() 971 960 { 972 961 m_fAllowResetFirstRunFlag = true; 973 962 } 974 963 975 void UI VMSettingsDlg::sltSetFirstRunFlag()964 void UISettingsDialogMachine::sltSetFirstRunFlag() 976 965 { 977 966 m_fResetFirstRunFlag = false; 978 967 } 979 968 980 void UI VMSettingsDlg::sltResetFirstRunFlag()969 void UISettingsDialogMachine::sltResetFirstRunFlag() 981 970 { 982 971 if (m_fAllowResetFirstRunFlag) … … 984 973 } 985 974 986 bool UI VMSettingsDlg::isAvailable(int id)975 bool UISettingsDialogMachine::isAvailable(int id) 987 976 { 988 977 if (m_machine.isNull()) -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.h
r34543 r36323 6 6 7 7 /* 8 * Copyright (C) 2006-201 0Oracle Corporation8 * Copyright (C) 2006-2011 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 25 25 26 26 /* Dialog which encapsulate all the specific functionalities of the Global Settings */ 27 class UI GLSettingsDlg: public UISettingsDialog27 class UISettingsDialogGlobal : public UISettingsDialog 28 28 { 29 29 Q_OBJECT; … … 43 43 }; 44 44 45 UI GLSettingsDlg(QWidget *pParent);45 UISettingsDialogGlobal(QWidget *pParent); 46 46 47 47 protected: … … 60 60 61 61 /* Dialog which encapsulate all the specific functionalities of the Virtual Machine Settings */ 62 class UI VMSettingsDlg: public UISettingsDialog62 class UISettingsDialogMachine : public UISettingsDialog 63 63 { 64 64 Q_OBJECT; … … 82 82 }; 83 83 84 UI VMSettingsDlg(QWidget *pParent, const CMachine &machine,85 const QString &strCategory, const QString &strControl);84 UISettingsDialogMachine(QWidget *pParent, const CMachine &machine, 85 const QString &strCategory, const QString &strControl); 86 86 87 87 protected:
Note:
See TracChangeset
for help on using the changeset viewer.