if (QFile::exists(m_state.storePath + QStringLiteral("/.gpg-id"))) {
return Done;
} else {
return KeySelect;
}
case KeySelect:
return Done;
default:
return -1;
}
return -1;
};
IntroPage::IntroPage(DialogState &s)
: m_state(s)
{
QVBoxLayout *lay = new QVBoxLayout();
lay->addWidget(new QLabel(i18n("Welcome to GnuPG Password manager")));
setTitle(i18n("Welcome"));
setSubTitle(i18n("Setting up"));
setLayout(lay);
}
KeyGenPage::KeyGenPage(DialogState &s)
: m_state(s)
{
setTitle(i18n("Generate keys"));
setSubTitle(i18n("Generate keys"));
m_ui = std::make_unique<Ui_KeyGenWidget>();
m_ui->setupUi(this);
m_ui->spinner->hide();
m_ui->generateButton->setEnabled(false);
m_ui->message->hide();
m_ui->email->setValidator(
new QRegularExpressionValidator(QRegularExpression(QRegularExpression::anchoredPattern(QStringLiteral(R"(\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b)")),
* @brief MainWindow::initStatusBar init statusBar with default message and logo
*/
void MainWindow::initStatusBar()
{
ui->statusBar->showMessage(i18nc("placeholder is version number","Welcome to GnuPG Password Manager %1", QString::fromLocal8Bit(GPGPASS_VERSION_STRING)));
QPixmap logo = QPixmap(QStringLiteral(":/artwork/32-gpgpass.png"));
QMessageBox::critical(nullptr, QStringLiteral("error"), QStringLiteral("file not in pass store called from %1 %2 %3").arg(QString::fromLocal8Bit(location),file,Settings::getPassStore()));
qWarning() << "file without suffix called from " << location;
QMessageBox::critical(nullptr, QStringLiteral("error"), QStringLiteral("file without suffix called from %1 %2").arg(QString::fromLocal8Bit(location),file));
return false;
}
/**
* @brief Pass::Pass wrapper for using either pass or the pass imitation
*/
Pass::Pass()
{
}
/**
* @brief Pass::Generate use either pwgen or internal password
* generator
* @param length of the desired password
* @param charset to use for generation
* @return the password
*/
QString Pass::Generate_b(unsigned int length, const QString &charset)
{
if (charset.length() > 0) {
return generateRandomPassword(charset, length);
} else {
Q_EMIT critical(i18n("No characters chosen"),
i18n("Can't generate password, there are no characters to choose from "