| 209 | } |
| 210 | |
| 211 | bool AskPassphraseDialog::event(QEvent *event) |
| 212 | { |
| 213 | // Detect Caps Lock key press. |
| 214 | if (event->type() == QEvent::KeyPress) { |
| 215 | QKeyEvent *ke = static_cast<QKeyEvent *>(event); |
| 216 | if (ke->key() == Qt::Key_CapsLock) { |
| 217 | fCapsLock = !fCapsLock; |
| 218 | } |
| 219 | if (fCapsLock) { |
| 220 | ui->capsLabel->setText(tr("Warning: The Caps Lock key is on!")); |
| 221 | } else { |
| 222 | ui->capsLabel->clear(); |
| 223 | } |
| 224 | } |
| 225 | return QWidget::event(event); |
| 226 | } |
| 227 | |
| 228 | void AskPassphraseDialog::toggleShowPassword(bool show) |
| 229 | { |