QWizardPage *AuthenticationWizard::createQAPage() { QWizardPage *page = new QWizardPage(); QGridLayout *layout = new QGridLayout(); layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding), 0, 0); if(initiate) { page->setTitle(i18nc("@title", "Question and Answer")); lQuestion = new QLabel(i18nc("@info", "Enter a question that only <b>%1</b> is able to answer:", contact)); layout->addWidget(lQuestion); leQuestion = new QLineEdit(); layout->addWidget(leQuestion); lAnswer = new QLabel(i18nc("@info", "Enter the answer to your question:")); layout->addWidget(lAnswer); } else { if(!question.isEmpty()) { page->setTitle(i18nc("@title", "Authentication with <b>%1</b>", contact)); lQuestion = new QLabel(i18nc("@info", "<b>%1</b> would like to verify your authentication. " "Please answer the following question in the field below:", contact)); layout->setRowMinimumHeight(1, 30); lQuestion->setWordWrap(true); layout->addWidget(lQuestion); lAnswer = new QLabel(question); QFont font = lAnswer->font(); font.setItalic(true); lAnswer->setFont(font); lAnswer->setWordWrap(true); layout->addWidget(lAnswer); } } leAnswer = new QLineEdit(); layout->addWidget(leAnswer); layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding), 5, 0); page->setLayout(layout); page->setCommitPage(true); return page; }
QWizardPage *AuthenticationWizard::createSSPage() { QWizardPage *page = new QWizardPage(); QGridLayout *layout = new QGridLayout(); layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding), 0, 0); if(initiate) { page->setTitle(i18nc("@title", "Shared Secret")); layout->addWidget(new QLabel(i18nc("@info", "Enter a secret passphrase known only to you and <b>%1</b>:", contact))); } else { page->setTitle(i18nc("@title", "Authentication with <b>%1</b>", contact)); layout->addWidget(new QLabel(i18nc("@info", "Enter the secret passphrase known only to you and <b>%1</b>:", contact))); } leSecret = new QLineEdit(); layout->addWidget(leSecret); layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding), 4, 0); page->setLayout(layout); page->setCommitPage(true); return page; }