Changeset 55135 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 8, 2015 1:40:04 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 99434
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIAddDiskEncryptionPasswordDialog.cpp
r55092 r55135 68 68 void sigCommitData(QWidget *pThis); 69 69 70 /** Notifies listeners about Enter/Return key triggering. */ 71 void sigEnterKeyTriggered(); 72 70 73 public: 71 74 … … 83 86 /** Prepare routine. */ 84 87 void prepare(); 88 89 /** Key press @a pEvent handler. */ 90 void keyPressEvent(QKeyEvent *pEvent); 85 91 86 92 /** Property: Returns the current password of the editor. */ … … 154 160 void sigDataChanged(); 155 161 162 /** Notifies listeners about editor's Enter/Return key triggering. */ 163 void sigEditorEnterKeyTriggered(); 164 156 165 public: 157 166 … … 203 212 connect(this, SIGNAL(textChanged(const QString&)), 204 213 this, SLOT(sltPasswordChanged(const QString&))); 214 } 215 216 void UIPasswordEditor::keyPressEvent(QKeyEvent *pEvent) 217 { 218 /* Call to base-class: */ 219 QLineEdit::keyPressEvent(pEvent); 220 221 /* Broadcast Enter/Return key press: */ 222 switch (pEvent->key()) 223 { 224 case Qt::Key_Enter: 225 case Qt::Key_Return: 226 emit sigEnterKeyTriggered(); 227 break; 228 default: 229 break; 230 } 205 231 } 206 232 … … 467 493 delete itemDelegate(); 468 494 setItemDelegate(pStyledItemDelegate); 495 /* Configure item delegate: */ 496 pStyledItemDelegate->setWatchForEditorEnterKeyTriggering(true); 497 connect(pStyledItemDelegate, SIGNAL(sigEditorEnterKeyTriggered()), 498 this, SIGNAL(sigEditorEnterKeyTriggered())); 469 499 } 470 500 … … 507 537 AssertPtrReturn(m_pTableEncryptionData, EncryptionPasswordMap()); 508 538 return m_pTableEncryptionData->encryptionPasswords(); 539 } 540 541 void UIAddDiskEncryptionPasswordDialog::sltEditorEnterKeyTriggered() 542 { 543 if (m_pButtonBox->button(QDialogButtonBox::Ok)->isEnabled()) 544 accept(); 509 545 } 510 546 … … 536 572 connect(m_pTableEncryptionData, SIGNAL(sigDataChanged()), 537 573 this, SLOT(sltDataChanged())); 574 connect(m_pTableEncryptionData, SIGNAL(sigEditorEnterKeyTriggered()), 575 this, SLOT(sltEditorEnterKeyTriggered())); 538 576 m_pTableEncryptionData->setFocus(); 539 577 m_pTableEncryptionData->editFirstIndex(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIAddDiskEncryptionPasswordDialog.h
r55016 r55135 59 59 void sltDataChanged() { revalidate(); } 60 60 61 /** Handles editor's Enter/Return key triggering. */ 62 void sltEditorEnterKeyTriggered(); 63 61 64 private: 62 65
Note:
See TracChangeset
for help on using the changeset viewer.