Changeset 85751 in vbox for trunk/src/VBox
- Timestamp:
- Aug 13, 2020 3:26:14 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139899
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro
r85750 r85751 32 32 src/settings/global/UIGlobalSettingsExtension.ui \ 33 33 src/settings/global/UIGlobalSettingsProxy.ui \ 34 src/settings/machine/UIMachineSettingsGeneral.ui \35 34 src/settings/machine/UIMachineSettingsNetwork.ui \ 36 35 src/settings/machine/UIMachineSettingsUSB.ui \ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp
r84790 r85751 17 17 18 18 /* Qt includes: */ 19 #include <QCheckBox> 20 #include <QComboBox> 19 21 #include <QDir> 22 #include <QLabel> 20 23 #include <QLineEdit> 24 #include <QTextEdit> 25 #include <QVBoxLayout> 21 26 22 27 /* GUI includes: */ 28 #include "QITabWidget.h" 23 29 #include "QIWidgetValidator.h" 24 30 #include "UICommon.h" 25 31 #include "UIConverter.h" 26 32 #include "UIErrorString.h" 33 #include "UIFilePathSelector.h" 27 34 #include "UIMachineSettingsGeneral.h" 28 35 #include "UIModalWindowManager.h" 36 #include "UINameAndSystemEditor.h" 29 37 #include "UIProgressDialog.h" 30 38 … … 117 125 , m_fEncryptionPasswordChanged(false) 118 126 , m_pCache(0) 127 , m_pNameAndSystemEditor(0) 128 , mPsSnapshot(0) 129 , mCbClipboard(0) 130 , m_pComboCipher(0) 131 , mCbDragAndDrop(0) 132 , mTeDescription(0) 133 , m_pEditorEncryptionPassword(0) 134 , m_pEditorEncryptionPasswordConfirm(0) 135 , m_pCheckBoxEncryption(0) 136 , m_pTabWidgetGeneral(0) 137 , m_pTabBasic(0) 138 , m_pTabDescription(0) 139 , m_pTabAdvanced(0) 140 , m_pTabEncryption(0) 141 , m_pWidgetEncryption(0) 142 , m_pLabelDragAndDrop(0) 143 , m_pLabelCipher(0) 144 , m_pLabelSnapshot(0) 145 , m_pLabelClipboard(0) 146 , m_pLabelPassword1(0) 147 , m_pLabelPassword2(0) 119 148 { 120 149 /* Prepare: */ … … 354 383 355 384 /* 'Basic' tab validations: */ 356 message.first = UICommon::removeAccelMark(m TwGeneral->tabText(0));385 message.first = UICommon::removeAccelMark(m_pTabWidgetGeneral->tabText(0)); 357 386 message.second.clear(); 358 387 … … 378 407 379 408 /* 'Encryption' tab validations: */ 380 message.first = UICommon::removeAccelMark(m TwGeneral->tabText(3));409 message.first = UICommon::removeAccelMark(m_pTabWidgetGeneral->tabText(3)); 381 410 message.second.clear(); 382 411 … … 436 465 /* 'Basic' tab: */ 437 466 AssertPtrReturnVoid(pWidget); 438 AssertPtrReturnVoid(m TwGeneral);439 AssertPtrReturnVoid(m TwGeneral->focusProxy());467 AssertPtrReturnVoid(m_pTabWidgetGeneral); 468 AssertPtrReturnVoid(m_pTabWidgetGeneral->focusProxy()); 440 469 AssertPtrReturnVoid(m_pNameAndSystemEditor); 441 setTabOrder(pWidget, m TwGeneral->focusProxy());442 setTabOrder(m TwGeneral->focusProxy(), m_pNameAndSystemEditor);470 setTabOrder(pWidget, m_pTabWidgetGeneral->focusProxy()); 471 setTabOrder(m_pTabWidgetGeneral->focusProxy(), m_pNameAndSystemEditor); 443 472 444 473 /* 'Advanced' tab: */ … … 457 486 void UIMachineSettingsGeneral::retranslateUi() 458 487 { 459 /* Translate uic generated strings: */ 460 Ui::UIMachineSettingsGeneral::retranslateUi(this); 488 m_pTabWidgetGeneral->setTabText(m_pTabWidgetGeneral->indexOf(m_pTabBasic), QApplication::translate("UIMachineSettingsGeneral", "Basi&c")); 489 m_pLabelSnapshot->setText(QApplication::translate("UIMachineSettingsGeneral", "S&napshot Folder:")); 490 m_pLabelClipboard->setText(QApplication::translate("UIMachineSettingsGeneral", "&Shared Clipboard:")); 491 mCbClipboard->setWhatsThis(QApplication::translate("UIMachineSettingsGeneral", "Selects which clipboard data will be copied " 492 "between the guest and the host OS. This feature requires Guest Additions " 493 "to be installed in the guest OS.")); 494 m_pLabelDragAndDrop->setText(QApplication::translate("UIMachineSettingsGeneral", "D&rag'n'Drop:")); 495 mCbDragAndDrop->setWhatsThis(QApplication::translate("UIMachineSettingsGeneral", "Selects which data will be copied between " 496 "the guest and the host OS by drag'n'drop. This feature requires Guest " 497 "Additions to be installed in the guest OS.")); 498 m_pTabWidgetGeneral->setTabText(m_pTabWidgetGeneral->indexOf(m_pTabAdvanced), QApplication::translate("UIMachineSettingsGeneral", "A&dvanced")); 499 mTeDescription->setWhatsThis(QApplication::translate("UIMachineSettingsGeneral", "Holds the description of the virtual machine. " 500 "The description field is useful for commenting on configuration details " 501 "of the installed guest OS.")); 502 m_pTabWidgetGeneral->setTabText(m_pTabWidgetGeneral->indexOf(m_pTabDescription), QApplication::translate("UIMachineSettingsGeneral", "D&escription")); 503 m_pCheckBoxEncryption->setWhatsThis(QApplication::translate("UIMachineSettingsGeneral", "When checked, disks attached to this " 504 "virtual machine will be encrypted.")); 505 m_pCheckBoxEncryption->setText(QApplication::translate("UIMachineSettingsGeneral", "En&able Disk Encryption")); 506 m_pLabelCipher->setText(QApplication::translate("UIMachineSettingsGeneral", "Disk Encryption C&ipher:")); 507 m_pComboCipher->setWhatsThis(QApplication::translate("UIMachineSettingsGeneral", "Selects the cipher to be used for encrypting " 508 "the virtual machine disks.")); 509 m_pLabelPassword1->setText(QApplication::translate("UIMachineSettingsGeneral", "E&nter New Password:")); 510 m_pEditorEncryptionPassword->setWhatsThis(QApplication::translate("UIMachineSettingsGeneral", "Holds the encryption password " 511 "for disks attached to this virtual machine.")); 512 m_pLabelPassword2->setText(QApplication::translate("UIMachineSettingsGeneral", "C&onfirm New Password:")); 513 m_pEditorEncryptionPasswordConfirm->setWhatsThis(QApplication::translate("UIMachineSettingsGeneral", "Confirms the disk encryption password.")); 514 m_pTabWidgetGeneral->setTabText(m_pTabWidgetGeneral->indexOf(m_pTabEncryption), QApplication::translate("UIMachineSettingsGeneral", "Disk Enc&ryption")); 461 515 462 516 /* Translate path selector: */ … … 496 550 497 551 /* Polish 'Advanced' availability: */ 498 AssertPtrReturnVoid(m LbSnapshot);552 AssertPtrReturnVoid(m_pLabelSnapshot); 499 553 AssertPtrReturnVoid(mPsSnapshot); 500 AssertPtrReturnVoid(m LbClipboard);554 AssertPtrReturnVoid(m_pLabelClipboard); 501 555 AssertPtrReturnVoid(mCbClipboard); 502 AssertPtrReturnVoid(m LbDragAndDrop);556 AssertPtrReturnVoid(m_pLabelDragAndDrop); 503 557 AssertPtrReturnVoid(mCbDragAndDrop); 504 m LbSnapshot->setEnabled(isMachineOffline());558 m_pLabelSnapshot->setEnabled(isMachineOffline()); 505 559 mPsSnapshot->setEnabled(isMachineOffline()); 506 m LbClipboard->setEnabled(isMachineInValidMode());560 m_pLabelClipboard->setEnabled(isMachineInValidMode()); 507 561 mCbClipboard->setEnabled(isMachineInValidMode()); 508 m LbDragAndDrop->setEnabled(isMachineInValidMode());562 m_pLabelDragAndDrop->setEnabled(isMachineInValidMode()); 509 563 mCbDragAndDrop->setEnabled(isMachineInValidMode()); 510 564 … … 522 576 void UIMachineSettingsGeneral::prepare() 523 577 { 524 /* Apply UI decorations: */ 525 Ui::UIMachineSettingsGeneral::setupUi(this); 578 prepareWidgets(); 526 579 527 580 /* Prepare cache: */ … … 543 596 /* Apply language settings: */ 544 597 retranslateUi(); 598 } 599 600 void UIMachineSettingsGeneral::prepareWidgets() 601 { 602 QHBoxLayout *mLtMain; 603 604 605 QVBoxLayout *mLtBasic; 606 607 QSpacerItem *mSpVer1; 608 609 QVBoxLayout *mLtAdvanced; 610 QWidget *mWtAdvanced; 611 QGridLayout *mLtAdvancedItems; 612 613 614 615 616 QSpacerItem *mSpHor1; 617 618 619 QSpacerItem *mSpHor2; 620 QSpacerItem *mSpVer3; 621 622 QVBoxLayout *mLtDescription; 623 QGridLayout *m_pLayoutEncryption; 624 625 QSpacerItem *spacerItem; 626 QGridLayout *m_pLayoutEncryptionSettings; 627 628 629 QSpacerItem *spacerItem1; 630 631 if (objectName().isEmpty()) 632 setObjectName(QStringLiteral("UIMachineSettingsGeneral")); 633 resize(350, 250); 634 mLtMain = new QHBoxLayout(this); 635 mLtMain->setObjectName(QStringLiteral("mLtMain")); 636 m_pTabWidgetGeneral = new QITabWidget(); 637 m_pTabWidgetGeneral->setObjectName(QStringLiteral("m_pTabWidgetGeneral")); 638 m_pTabBasic = new QWidget(); 639 m_pTabBasic->setObjectName(QStringLiteral("m_pTabBasic")); 640 mLtBasic = new QVBoxLayout(m_pTabBasic); 641 mLtBasic->setSpacing(0); 642 mLtBasic->setObjectName(QStringLiteral("mLtBasic")); 643 m_pNameAndSystemEditor = new UINameAndSystemEditor(m_pTabBasic); 644 m_pNameAndSystemEditor->setObjectName(QStringLiteral("m_pNameAndSystemEditor")); 645 646 mLtBasic->addWidget(m_pNameAndSystemEditor); 647 648 mSpVer1 = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); 649 650 mLtBasic->addItem(mSpVer1); 651 652 m_pTabWidgetGeneral->addTab(m_pTabBasic, QString()); 653 m_pTabAdvanced = new QWidget(); 654 m_pTabAdvanced->setObjectName(QStringLiteral("m_pTabAdvanced")); 655 mLtAdvanced = new QVBoxLayout(m_pTabAdvanced); 656 mLtAdvanced->setSpacing(0); 657 mLtAdvanced->setObjectName(QStringLiteral("mLtAdvanced")); 658 mWtAdvanced = new QWidget(m_pTabAdvanced); 659 mWtAdvanced->setObjectName(QStringLiteral("mWtAdvanced")); 660 mLtAdvancedItems = new QGridLayout(mWtAdvanced); 661 mLtAdvancedItems->setContentsMargins(0, 0, 0, 0); 662 mLtAdvancedItems->setObjectName(QStringLiteral("mLtAdvancedItems")); 663 m_pLabelSnapshot = new QLabel(mWtAdvanced); 664 m_pLabelSnapshot->setObjectName(QStringLiteral("m_pLabelSnapshot")); 665 m_pLabelSnapshot->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 666 667 mLtAdvancedItems->addWidget(m_pLabelSnapshot, 0, 0, 1, 1); 668 669 mPsSnapshot = new UIFilePathSelector(mWtAdvanced); 670 mPsSnapshot->setObjectName(QStringLiteral("mPsSnapshot")); 671 QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); 672 sizePolicy.setHorizontalStretch(0); 673 sizePolicy.setVerticalStretch(0); 674 sizePolicy.setHeightForWidth(mPsSnapshot->sizePolicy().hasHeightForWidth()); 675 mPsSnapshot->setSizePolicy(sizePolicy); 676 677 mLtAdvancedItems->addWidget(mPsSnapshot, 0, 1, 1, 2); 678 679 m_pLabelClipboard = new QLabel(mWtAdvanced); 680 m_pLabelClipboard->setObjectName(QStringLiteral("m_pLabelClipboard")); 681 m_pLabelClipboard->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 682 683 mLtAdvancedItems->addWidget(m_pLabelClipboard, 1, 0, 1, 1); 684 685 mCbClipboard = new QComboBox(mWtAdvanced); 686 mCbClipboard->setObjectName(QStringLiteral("mCbClipboard")); 687 QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Fixed); 688 sizePolicy1.setHorizontalStretch(0); 689 sizePolicy1.setVerticalStretch(0); 690 sizePolicy1.setHeightForWidth(mCbClipboard->sizePolicy().hasHeightForWidth()); 691 mCbClipboard->setSizePolicy(sizePolicy1); 692 693 mLtAdvancedItems->addWidget(mCbClipboard, 1, 1, 1, 1); 694 695 mSpHor1 = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); 696 697 mLtAdvancedItems->addItem(mSpHor1, 1, 2, 1, 1); 698 699 m_pLabelDragAndDrop = new QLabel(mWtAdvanced); 700 m_pLabelDragAndDrop->setObjectName(QStringLiteral("m_pLabelDragAndDrop")); 701 m_pLabelDragAndDrop->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 702 703 mLtAdvancedItems->addWidget(m_pLabelDragAndDrop, 2, 0, 1, 1); 704 705 mCbDragAndDrop = new QComboBox(mWtAdvanced); 706 mCbDragAndDrop->setObjectName(QStringLiteral("mCbDragAndDrop")); 707 sizePolicy1.setHeightForWidth(mCbDragAndDrop->sizePolicy().hasHeightForWidth()); 708 mCbDragAndDrop->setSizePolicy(sizePolicy1); 709 710 mLtAdvancedItems->addWidget(mCbDragAndDrop, 2, 1, 1, 1); 711 712 mSpHor2 = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); 713 714 mLtAdvancedItems->addItem(mSpHor2, 2, 2, 1, 1); 715 716 717 mLtAdvanced->addWidget(mWtAdvanced); 718 719 mSpVer3 = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); 720 721 mLtAdvanced->addItem(mSpVer3); 722 723 m_pTabWidgetGeneral->addTab(m_pTabAdvanced, QString()); 724 m_pTabDescription = new QWidget(); 725 m_pTabDescription->setObjectName(QStringLiteral("m_pTabDescription")); 726 mLtDescription = new QVBoxLayout(m_pTabDescription); 727 mLtDescription->setSpacing(0); 728 mLtDescription->setObjectName(QStringLiteral("mLtDescription")); 729 mTeDescription = new QTextEdit(m_pTabDescription); 730 mTeDescription->setObjectName(QStringLiteral("mTeDescription")); 731 mTeDescription->setAcceptRichText(false); 732 733 mLtDescription->addWidget(mTeDescription); 734 735 m_pTabWidgetGeneral->addTab(m_pTabDescription, QString()); 736 m_pTabEncryption = new QWidget(); 737 m_pTabEncryption->setObjectName(QStringLiteral("m_pTabEncryption")); 738 m_pLayoutEncryption = new QGridLayout(m_pTabEncryption); 739 m_pLayoutEncryption->setObjectName(QStringLiteral("m_pLayoutEncryption")); 740 m_pCheckBoxEncryption = new QCheckBox(m_pTabEncryption); 741 m_pCheckBoxEncryption->setObjectName(QStringLiteral("m_pCheckBoxEncryption")); 742 743 m_pLayoutEncryption->addWidget(m_pCheckBoxEncryption, 0, 0, 1, 2); 744 745 spacerItem = new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum); 746 747 m_pLayoutEncryption->addItem(spacerItem, 1, 0, 1, 1); 748 749 m_pWidgetEncryption = new QWidget(m_pTabEncryption); 750 m_pWidgetEncryption->setObjectName(QStringLiteral("m_pWidgetEncryption")); 751 QSizePolicy sizePolicy2(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); 752 sizePolicy2.setHorizontalStretch(1); 753 sizePolicy2.setVerticalStretch(0); 754 sizePolicy2.setHeightForWidth(m_pWidgetEncryption->sizePolicy().hasHeightForWidth()); 755 m_pWidgetEncryption->setSizePolicy(sizePolicy2); 756 m_pLayoutEncryptionSettings = new QGridLayout(m_pWidgetEncryption); 757 m_pLayoutEncryptionSettings->setObjectName(QStringLiteral("m_pLayoutEncryptionSettings")); 758 m_pLayoutEncryptionSettings->setContentsMargins(0, 0, 0, 0); 759 m_pLabelCipher = new QLabel(m_pWidgetEncryption); 760 m_pLabelCipher->setObjectName(QStringLiteral("m_pLabelCipher")); 761 m_pLabelCipher->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 762 763 m_pLayoutEncryptionSettings->addWidget(m_pLabelCipher, 0, 0, 1, 1); 764 765 m_pComboCipher = new QComboBox(m_pWidgetEncryption); 766 m_pComboCipher->setObjectName(QStringLiteral("m_pComboCipher")); 767 768 m_pLayoutEncryptionSettings->addWidget(m_pComboCipher, 0, 1, 1, 1); 769 770 m_pLabelPassword1 = new QLabel(m_pWidgetEncryption); 771 m_pLabelPassword1->setObjectName(QStringLiteral("m_pLabelPassword1")); 772 m_pLabelPassword1->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 773 774 m_pLayoutEncryptionSettings->addWidget(m_pLabelPassword1, 1, 0, 1, 1); 775 776 m_pEditorEncryptionPassword = new QLineEdit(m_pWidgetEncryption); 777 m_pEditorEncryptionPassword->setObjectName(QStringLiteral("m_pEditorEncryptionPassword")); 778 779 m_pLayoutEncryptionSettings->addWidget(m_pEditorEncryptionPassword, 1, 1, 1, 1); 780 781 m_pLabelPassword2 = new QLabel(m_pWidgetEncryption); 782 m_pLabelPassword2->setObjectName(QStringLiteral("m_pLabelPassword2")); 783 m_pLabelPassword2->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 784 785 m_pLayoutEncryptionSettings->addWidget(m_pLabelPassword2, 2, 0, 1, 1); 786 787 m_pEditorEncryptionPasswordConfirm = new QLineEdit(m_pWidgetEncryption); 788 m_pEditorEncryptionPasswordConfirm->setObjectName(QStringLiteral("m_pEditorEncryptionPasswordConfirm")); 789 790 m_pLayoutEncryptionSettings->addWidget(m_pEditorEncryptionPasswordConfirm, 2, 1, 1, 1); 791 792 793 m_pLayoutEncryption->addWidget(m_pWidgetEncryption, 1, 1, 1, 1); 794 795 spacerItem1 = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); 796 797 m_pLayoutEncryption->addItem(spacerItem1, 2, 1, 1, 1); 798 799 m_pTabWidgetGeneral->addTab(m_pTabEncryption, QString()); 800 801 mLtMain->addWidget(m_pTabWidgetGeneral); 802 803 m_pLabelSnapshot->setBuddy(mPsSnapshot); 804 m_pLabelClipboard->setBuddy(mCbClipboard); 805 m_pLabelDragAndDrop->setBuddy(mCbDragAndDrop); 806 m_pLabelCipher->setBuddy(m_pComboCipher); 807 m_pLabelPassword1->setBuddy(m_pEditorEncryptionPassword); 808 m_pLabelPassword2->setBuddy(m_pEditorEncryptionPasswordConfirm); 809 810 811 QObject::connect(m_pCheckBoxEncryption, SIGNAL(toggled(bool)), m_pWidgetEncryption, SLOT(setEnabled(bool))); 812 813 m_pTabWidgetGeneral->setCurrentIndex(0); 545 814 } 546 815 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.h
r84790 r85751 25 25 #include "UIAddDiskEncryptionPasswordDialog.h" 26 26 #include "UISettingsPage.h" 27 #include "UIMachineSettingsGeneral.gen.h"28 27 29 28 /* Forward declarations: */ 29 class QCheckBox; 30 class QComboBox; 31 class QLineEdit; 32 class QTextEdit; 33 class QITabWidget; 34 class UINameAndSystemEditor; 35 36 class UIFilePathSelector; 30 37 struct UIDataSettingsMachineGeneral; 31 38 typedef UISettingsCache<UIDataSettingsMachineGeneral> UISettingsCacheMachineGeneral; 32 39 33 40 /** Machine settings: General page. */ 34 class SHARED_LIBRARY_STUFF UIMachineSettingsGeneral : public UISettingsPageMachine, 35 public Ui::UIMachineSettingsGeneral 41 class SHARED_LIBRARY_STUFF UIMachineSettingsGeneral : public UISettingsPageMachine 36 42 { 37 43 Q_OBJECT; … … 94 100 /** Prepares all. */ 95 101 void prepare(); 102 /** Prepares widgets. */ 103 void prepareWidgets(); 96 104 /** Prepares 'Basic' tab. */ 97 105 void prepareTabBasic(); … … 139 147 /** Holds the page data cache instance. */ 140 148 UISettingsCacheMachineGeneral *m_pCache; 149 /** @name Widgets 150 * @{ */ 151 UINameAndSystemEditor *m_pNameAndSystemEditor; 152 UIFilePathSelector *mPsSnapshot; 153 QComboBox *mCbClipboard; 154 QComboBox *m_pComboCipher; 155 QComboBox *mCbDragAndDrop; 156 QTextEdit *mTeDescription; 157 QLineEdit *m_pEditorEncryptionPassword; 158 QLineEdit *m_pEditorEncryptionPasswordConfirm; 159 QCheckBox *m_pCheckBoxEncryption; 160 QITabWidget *m_pTabWidgetGeneral; 161 QWidget *m_pTabBasic; 162 QWidget *m_pTabDescription; 163 QWidget *m_pTabAdvanced; 164 QWidget *m_pTabEncryption; 165 QWidget *m_pWidgetEncryption; 166 QLabel *m_pLabelDragAndDrop; 167 QLabel *m_pLabelCipher; 168 QLabel *m_pLabelSnapshot; 169 QLabel *m_pLabelClipboard; 170 QLabel *m_pLabelPassword1; 171 QLabel *m_pLabelPassword2; 172 /** @} */ 141 173 }; 142 174
Note:
See TracChangeset
for help on using the changeset viewer.