Changeset 94515 in vbox
- Timestamp:
- Apr 7, 2022 2:13:41 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIDiskEncryptionSettingsEditor.cpp
r94498 r94515 34 34 , m_pCheckboxFeature(0) 35 35 , m_pWidgetSettings(0) 36 , m_pLabelCipher (0)37 , m_pComboCipher (0)38 , m_pLabel EncryptionPassword(0)39 , m_pEditor EncryptionPassword(0)40 , m_pLabel EncryptionPasswordConfirm(0)41 , m_pEditor EncryptionPasswordConfirm(0)36 , m_pLabelCipherType(0) 37 , m_pComboCipherType(0) 38 , m_pLabelPassword1(0) 39 , m_pEditorPassword1(0) 40 , m_pLabelPassword2(0) 41 , m_pEditorPassword2(0) 42 42 { 43 43 prepare(); … … 77 77 UIDiskEncryptionCipherType UIDiskEncryptionSettingsEditor::cipherType() const 78 78 { 79 return m_pComboCipher ? m_pComboCipher->currentData().value<UIDiskEncryptionCipherType>() : m_enmCipherType;79 return m_pComboCipherType ? m_pComboCipherType->currentData().value<UIDiskEncryptionCipherType>() : m_enmCipherType; 80 80 } 81 81 82 82 QString UIDiskEncryptionSettingsEditor::password1() const 83 83 { 84 return m_pEditor EncryptionPassword ? m_pEditorEncryptionPassword->text() : m_strPassword1;84 return m_pEditorPassword1 ? m_pEditorPassword1->text() : m_strPassword1; 85 85 } 86 86 87 87 QString UIDiskEncryptionSettingsEditor::password2() const 88 88 { 89 return m_pEditor EncryptionPasswordConfirm ? m_pEditorEncryptionPasswordConfirm->text() : m_strPassword2;89 return m_pEditorPassword2 ? m_pEditorPassword2->text() : m_strPassword2; 90 90 } 91 91 … … 98 98 } 99 99 100 if (m_pLabelCipher )101 m_pLabelCipher ->setText(tr("Disk Encryption C&ipher:"));102 if (m_pComboCipher )103 { 104 for (int iIndex = 0; iIndex < m_pComboCipher ->count(); ++iIndex)100 if (m_pLabelCipherType) 101 m_pLabelCipherType->setText(tr("Disk Encryption C&ipher:")); 102 if (m_pComboCipherType) 103 { 104 for (int iIndex = 0; iIndex < m_pComboCipherType->count(); ++iIndex) 105 105 { 106 const UIDiskEncryptionCipherType enmType = m_pComboCipher ->itemData(iIndex).value<UIDiskEncryptionCipherType>();107 m_pComboCipher ->setItemText(iIndex, gpConverter->toString(enmType));106 const UIDiskEncryptionCipherType enmType = m_pComboCipherType->itemData(iIndex).value<UIDiskEncryptionCipherType>(); 107 m_pComboCipherType->setItemText(iIndex, gpConverter->toString(enmType)); 108 108 } 109 m_pComboCipher ->setToolTip(tr("Holds the cipher to be used for encrypting the virtual machine disks."));110 } 111 112 if (m_pLabel EncryptionPassword)113 m_pLabel EncryptionPassword->setText(tr("E&nter New Password:"));114 if (m_pEditor EncryptionPassword)115 m_pEditor EncryptionPassword->setToolTip(tr("Holds the encryption password for disks attached to this virtual machine."));116 if (m_pLabel EncryptionPasswordConfirm)117 m_pLabel EncryptionPasswordConfirm->setText(tr("C&onfirm New Password:"));118 if (m_pEditor EncryptionPasswordConfirm)119 m_pEditor EncryptionPasswordConfirm->setToolTip(tr("Confirms the disk encryption password."));109 m_pComboCipherType->setToolTip(tr("Holds the cipher to be used for encrypting the virtual machine disks.")); 110 } 111 112 if (m_pLabelPassword1) 113 m_pLabelPassword1->setText(tr("E&nter New Password:")); 114 if (m_pEditorPassword1) 115 m_pEditorPassword1->setToolTip(tr("Holds the encryption password for disks attached to this virtual machine.")); 116 if (m_pLabelPassword2) 117 m_pLabelPassword2->setText(tr("C&onfirm New Password:")); 118 if (m_pEditorPassword2) 119 m_pEditorPassword2->setToolTip(tr("Confirms the disk encryption password.")); 120 120 121 121 /* Translate Cipher type combo: */ 122 m_pComboCipher ->setItemText(0, tr("Leave Unchanged", "cipher type"));122 m_pComboCipherType->setItemText(0, tr("Leave Unchanged", "cipher type")); 123 123 } 124 124 … … 173 173 174 174 /* Prepare encryption cipher label: */ 175 m_pLabelCipher = new QLabel(m_pWidgetSettings);176 if (m_pLabelCipher )177 { 178 m_pLabelCipher ->setAlignment(Qt::AlignRight | Qt::AlignVCenter);179 m_pLayoutSettings->addWidget(m_pLabelCipher , 0, 0);175 m_pLabelCipherType = new QLabel(m_pWidgetSettings); 176 if (m_pLabelCipherType) 177 { 178 m_pLabelCipherType->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 179 m_pLayoutSettings->addWidget(m_pLabelCipherType, 0, 0); 180 180 } 181 181 /* Prepare encryption cipher combo: */ 182 m_pComboCipher = new QComboBox(m_pWidgetSettings);183 if (m_pComboCipher )184 { 185 if (m_pLabelCipher )186 m_pLabelCipher ->setBuddy(m_pComboCipher);187 m_pLayoutSettings->addWidget(m_pComboCipher , 0, 1);182 m_pComboCipherType = new QComboBox(m_pWidgetSettings); 183 if (m_pComboCipherType) 184 { 185 if (m_pLabelCipherType) 186 m_pLabelCipherType->setBuddy(m_pComboCipherType); 187 m_pLayoutSettings->addWidget(m_pComboCipherType, 0, 1); 188 188 } 189 189 190 190 /* Prepare encryption password label: */ 191 m_pLabel EncryptionPassword= new QLabel(m_pWidgetSettings);192 if (m_pLabel EncryptionPassword)193 { 194 m_pLabel EncryptionPassword->setAlignment(Qt::AlignRight | Qt::AlignVCenter);195 m_pLayoutSettings->addWidget(m_pLabel EncryptionPassword, 1, 0);191 m_pLabelPassword1 = new QLabel(m_pWidgetSettings); 192 if (m_pLabelPassword1) 193 { 194 m_pLabelPassword1->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 195 m_pLayoutSettings->addWidget(m_pLabelPassword1, 1, 0); 196 196 } 197 197 /* Prepare encryption password editor: */ 198 m_pEditor EncryptionPassword= new QLineEdit(m_pWidgetSettings);199 if (m_pEditor EncryptionPassword)200 { 201 if (m_pLabel EncryptionPassword)202 m_pLabel EncryptionPassword->setBuddy(m_pEditorEncryptionPassword);203 m_pEditor EncryptionPassword->setEchoMode(QLineEdit::Password);204 205 m_pLayoutSettings->addWidget(m_pEditor EncryptionPassword, 1, 1);198 m_pEditorPassword1 = new QLineEdit(m_pWidgetSettings); 199 if (m_pEditorPassword1) 200 { 201 if (m_pLabelPassword1) 202 m_pLabelPassword1->setBuddy(m_pEditorPassword1); 203 m_pEditorPassword1->setEchoMode(QLineEdit::Password); 204 205 m_pLayoutSettings->addWidget(m_pEditorPassword1, 1, 1); 206 206 } 207 207 208 208 /* Prepare encryption confirm password label: */ 209 m_pLabel EncryptionPasswordConfirm= new QLabel(m_pWidgetSettings);210 if (m_pLabel EncryptionPasswordConfirm)211 { 212 m_pLabel EncryptionPasswordConfirm->setAlignment(Qt::AlignRight | Qt::AlignVCenter);213 m_pLayoutSettings->addWidget(m_pLabel EncryptionPasswordConfirm, 2, 0);209 m_pLabelPassword2 = new QLabel(m_pWidgetSettings); 210 if (m_pLabelPassword2) 211 { 212 m_pLabelPassword2->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 213 m_pLayoutSettings->addWidget(m_pLabelPassword2, 2, 0); 214 214 } 215 215 /* Prepare encryption confirm password editor: */ 216 m_pEditor EncryptionPasswordConfirm= new QLineEdit(m_pWidgetSettings);217 if (m_pEditor EncryptionPasswordConfirm)218 { 219 if (m_pLabel EncryptionPasswordConfirm)220 m_pLabel EncryptionPasswordConfirm->setBuddy(m_pEditorEncryptionPasswordConfirm);221 m_pEditor EncryptionPasswordConfirm->setEchoMode(QLineEdit::Password);222 223 m_pLayoutSettings->addWidget(m_pEditor EncryptionPasswordConfirm, 2, 1);216 m_pEditorPassword2 = new QLineEdit(m_pWidgetSettings); 217 if (m_pEditorPassword2) 218 { 219 if (m_pLabelPassword2) 220 m_pLabelPassword2->setBuddy(m_pEditorPassword2); 221 m_pEditorPassword2->setEchoMode(QLineEdit::Password); 222 223 m_pLayoutSettings->addWidget(m_pEditorPassword2, 2, 1); 224 224 } 225 225 } … … 239 239 connect(m_pCheckboxFeature, &QCheckBox::toggled, 240 240 this, &UIDiskEncryptionSettingsEditor::sltHandleFeatureToggled); 241 if (m_pComboCipher )242 connect(m_pComboCipher , static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),241 if (m_pComboCipherType) 242 connect(m_pComboCipherType, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 243 243 this, &UIDiskEncryptionSettingsEditor::sigCipherChanged); 244 if (m_pEditor EncryptionPassword)245 connect(m_pEditor EncryptionPassword, &QLineEdit::textEdited,244 if (m_pEditorPassword1) 245 connect(m_pEditorPassword1, &QLineEdit::textEdited, 246 246 this, &UIDiskEncryptionSettingsEditor::sigPasswordChanged); 247 if (m_pEditor EncryptionPasswordConfirm)248 connect(m_pEditor EncryptionPasswordConfirm, &QLineEdit::textEdited,247 if (m_pEditorPassword2) 248 connect(m_pEditorPassword2, &QLineEdit::textEdited, 249 249 this, &UIDiskEncryptionSettingsEditor::sigPasswordChanged); 250 250 } … … 252 252 void UIDiskEncryptionSettingsEditor::repopulateCombo() 253 253 { 254 if (m_pComboCipher )254 if (m_pComboCipherType) 255 255 { 256 256 /* Clear combo first of all: */ 257 m_pComboCipher ->clear();257 m_pComboCipherType->clear(); 258 258 259 259 /// @todo get supported auth types (API not implemented), not hardcoded! … … 269 269 /* Populate combo finally: */ 270 270 foreach (const UIDiskEncryptionCipherType &enmType, cipherTypes) 271 m_pComboCipher ->addItem(gpConverter->toString(enmType), QVariant::fromValue(enmType));271 m_pComboCipherType->addItem(gpConverter->toString(enmType), QVariant::fromValue(enmType)); 272 272 273 273 /* Look for proper index to choose: */ 274 const int iIndex = m_pComboCipher ->findData(QVariant::fromValue(m_enmCipherType));274 const int iIndex = m_pComboCipherType->findData(QVariant::fromValue(m_enmCipherType)); 275 275 if (iIndex != -1) 276 m_pComboCipher ->setCurrentIndex(iIndex);277 } 278 } 276 m_pComboCipherType->setCurrentIndex(iIndex); 277 } 278 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIDiskEncryptionSettingsEditor.h
r94498 r94515 110 110 QWidget *m_pWidgetSettings; 111 111 /** Holds the cipher type label instance. */ 112 QLabel *m_pLabelCipher ;112 QLabel *m_pLabelCipherType; 113 113 /** Holds the cipher type combo instance. */ 114 QComboBox *m_pComboCipher ;115 /** Holds the enter passwordlabel instance. */116 QLabel *m_pLabel EncryptionPassword;117 /** Holds the enter passwordeditor instance. */118 QLineEdit *m_pEditor EncryptionPassword;119 /** Holds the confirm passwordlabel instance. */120 QLabel *m_pLabel EncryptionPasswordConfirm;121 /** Holds the confirm passwordeditor instance. */122 QLineEdit *m_pEditor EncryptionPasswordConfirm;114 QComboBox *m_pComboCipherType; 115 /** Holds the password 1 label instance. */ 116 QLabel *m_pLabelPassword1; 117 /** Holds the password 1 editor instance. */ 118 QLineEdit *m_pEditorPassword1; 119 /** Holds the password 2 label instance. */ 120 QLabel *m_pLabelPassword2; 121 /** Holds the password 2 editor instance. */ 122 QLineEdit *m_pEditorPassword2; 123 123 /** @} */ 124 124 }; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIMachineAudioFeaturesEditor.cpp
r94395 r94515 23 23 /* GUI includes: */ 24 24 #include "UIMachineAudioFeaturesEditor.h" 25 #ifdef VBOX_WS_X1126 # include "VBoxUtils-x11.h"27 #endif28 25 29 26 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp
r94498 r94515 17 17 18 18 /* Qt includes: */ 19 #include <QCheckBox> 20 #include <QComboBox> 21 #include <QDir> 22 #include <QLabel> 23 #include <QLineEdit> 24 #include <QTextEdit> 19 #include <QFileInfo> 25 20 #include <QVBoxLayout> 26 21 27 22 /* GUI includes: */ 28 23 #include "QITabWidget.h" 29 #include "QIWidgetValidator.h"30 24 #include "UIAddDiskEncryptionPasswordDialog.h" 31 25 #include "UICommon.h"
Note:
See TracChangeset
for help on using the changeset viewer.