| 29 | extern Global global; |
| 30 | |
| 31 | EnDecryptDialog::EnDecryptDialog(QWidget *parent) : |
| 32 | QDialog(parent) |
| 33 | { |
| 34 | okPressed = false; |
| 35 | setWindowTitle(tr("Decrypt")); |
| 36 | setWindowIcon(global.getIconResource(":passwordIcon")); |
| 37 | grid = new QGridLayout(this); |
| 38 | setLayout(grid); |
| 39 | |
| 40 | password = new QLineEdit(this); |
| 41 | hintLabel = new QLabel(this); |
| 42 | hint = new QLabel(this); |
| 43 | passwordGrid = new QGridLayout(this); |
| 44 | buttonGrid = new QGridLayout(this); |
| 45 | |
| 46 | ok= new QPushButton(this); |
| 47 | cancel = new QPushButton(this); |
| 48 | connect(password, SIGNAL(textChanged(const QString&)), this, SLOT(validateInput())); |
| 49 | |
| 50 | passwordLabel = new QLabel(); |
| 51 | passwordLabel->setText(tr("Password")); |
| 52 | hintLabel->setText(tr("Hint")); |
| 53 | passwordGrid->addWidget(passwordLabel, 1,1); |
| 54 | passwordGrid->addWidget(password, 1, 2); |
| 55 | passwordGrid->addWidget(hintLabel, 2,1); |
| 56 | passwordGrid->addWidget(hint, 2, 2); |
| 57 | rememberPassword = new QCheckBox(this); |
| 58 | permanentlyDecrypt = new QCheckBox(this); |
| 59 | passwordGrid->addWidget(new QLabel(tr("Permanently Decrypt")), 3,1); |
| 60 | passwordGrid->addWidget(permanentlyDecrypt, 3,2); |
| 61 | passwordGrid->addWidget(new QLabel(tr("Remember Password")), 4,1); |
| 62 | passwordGrid->addWidget(rememberPassword, 4,2); |
| 63 | passwordGrid->setContentsMargins(10, 10, -10, -10); |
| 64 | grid->addLayout(passwordGrid,1,1); |
| 65 | |
| 66 | ok->setText(tr("OK")); |
| 67 | if (global.password == "" and global.username == "") |
| 68 | ok->setEnabled(false); |
| 69 | connect(ok, SIGNAL(clicked()), this, SLOT(okButtonPressed())); |
| 70 | cancel->setText(tr("Cancel")); |
| 71 | connect(cancel, SIGNAL(clicked()), this, SLOT(cancelButtonPressed())); |
| 72 | buttonGrid->addWidget(ok, 1, 1); |
| 73 | buttonGrid->addWidget(cancel, 1,2); |
| 74 | grid->addLayout(buttonGrid,2,1); |
| 75 | grid->setSizeConstraint( QLayout::SetFixedSize ); |
| 76 | |
| 77 | password->setEchoMode(QLineEdit::Password); |
| 78 | this->setFont(global.getGuiFont(font())); |
| 79 | } |
| 80 | |
| 81 | |
| 82 |
nothing calls this directly
no test coverage detected