| 24 | extern Global global; |
| 25 | |
| 26 | EnCryptDialog::EnCryptDialog(QWidget *parent) : |
| 27 | QDialog(parent) |
| 28 | { |
| 29 | |
| 30 | wasOkPressed = false; |
| 31 | setWindowTitle(tr("Encrypt Text")); |
| 32 | //setWindowIcon(new QIcon(iconPath+"password.png")); |
| 33 | QGridLayout *grid = new QGridLayout(this); |
| 34 | QGridLayout *input = new QGridLayout(this); |
| 35 | QGridLayout *msgGrid = new QGridLayout(this); |
| 36 | QGridLayout *button = new QGridLayout(this); |
| 37 | setLayout(grid); |
| 38 | |
| 39 | |
| 40 | hint.setText(""); |
| 41 | password.setText(""); |
| 42 | password.setEchoMode(QLineEdit::Password); |
| 43 | password2.setText(""); |
| 44 | password2.setEchoMode(QLineEdit::Password); |
| 45 | |
| 46 | |
| 47 | input->addWidget(new QLabel(tr("Password"), this), 1,1); |
| 48 | input->addWidget(&password, 1, 2); |
| 49 | input->addWidget(new QLabel(tr("Verify"), this), 2,1); |
| 50 | input->addWidget(&password2, 2, 2); |
| 51 | input->addWidget(new QLabel(tr("Hint"), this), 3,1); |
| 52 | input->addWidget(&hint, 3, 2); |
| 53 | input->addWidget(new QLabel(tr("Remember Password")), 4,1); |
| 54 | input->addWidget(&rememberPassword, 4,2); |
| 55 | input->setContentsMargins(10, 10, -10, -10); |
| 56 | grid->addLayout(input, 1,1); |
| 57 | |
| 58 | msgGrid->addWidget(&error, 1, 1); |
| 59 | grid->addLayout(msgGrid, 2, 1); |
| 60 | |
| 61 | ok.setText(tr("OK")); |
| 62 | connect(&ok, SIGNAL(clicked()), this, SLOT(okButtonPressed())); |
| 63 | ok.setEnabled(false); |
| 64 | |
| 65 | QPushButton *cancel = new QPushButton(tr("Cancel"), this); |
| 66 | connect(cancel, SIGNAL(clicked()), this, SLOT(cancelButtonPressed())); |
| 67 | button->addWidget(&ok, 1, 1); |
| 68 | button->addWidget(cancel, 1,2); |
| 69 | grid->addLayout(button, 3, 1); |
| 70 | |
| 71 | connect(&password, SIGNAL(textChanged(QString)), this, SLOT(validateInput())); |
| 72 | connect(&password2, SIGNAL(textChanged(QString)), this, SLOT(validateInput())); |
| 73 | connect(&hint, SIGNAL(textChanged(QString)), this, SLOT(validateInput())); |
| 74 | this->setFont(global.getGuiFont(font())); |
| 75 | |
| 76 | } |
| 77 | |
| 78 | // The OK button was pressed |
| 79 | void EnCryptDialog::okButtonPressed() { |
nothing calls this directly
no test coverage detected