Commit 312d032a authored by Rafael Roquetto's avatar Rafael Roquetto

BlackBerry: fix password prompt alignment

Align certificate and csk password prompts according to their parents

Task-number: QTCREATORBUG-10948

Change-Id: I139019b2a5a73f5082a434518c62be97c63574e8
Reviewed-by: default avatarDavid Kaspar <dkaspar@blackberry.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 7f5166f3
......@@ -144,8 +144,8 @@ void BlackBerryDebugTokenRequestDialog::requestDebugToken()
BlackBerryConfigurationManager &configuration = BlackBerryConfigurationManager::instance();
m_requester->requestDebugToken(m_ui->debugTokenPath->path(),
m_utils.cskPassword(), configuration.defaultKeystorePath(),
m_utils.certificatePassword(), m_ui->devicePin->text());
m_utils.cskPassword(this), configuration.defaultKeystorePath(),
m_utils.certificatePassword(this), m_ui->devicePin->text());
}
void BlackBerryDebugTokenRequestDialog::setDefaultPath()
......
......@@ -169,7 +169,7 @@ void BlackBerryKeysWidget::updateKeysSection()
void BlackBerryKeysWidget::loadDefaultCertificate()
{
connect(&m_utils, SIGNAL(defaultCertificateLoaded(int)), this, SLOT(certificateLoaded(int)));
m_utils.openDefaultCertificate();
m_utils.openDefaultCertificate(this);
}
void BlackBerryKeysWidget::setCertificateError(const QString &error)
......
......@@ -406,7 +406,7 @@ void BlackBerrySetupWizard::requestDebugToken()
BlackBerryConfigurationManager &configuration = BlackBerryConfigurationManager::instance();
m_requester->requestDebugToken(configuration.defaultDebugTokenPath(),
m_utils.cskPassword(), configuration.defaultKeystorePath(), certificatePassword(), m_devicePin);
m_utils.cskPassword(this), configuration.defaultKeystorePath(), certificatePassword(), m_devicePin);
}
void BlackBerrySetupWizard::uploadDebugToken()
......
......@@ -82,18 +82,18 @@ bool BlackBerrySigningUtils::hasDefaultCertificate()
return keystore.exists();
}
QString BlackBerrySigningUtils::cskPassword()
QString BlackBerrySigningUtils::cskPassword(QWidget *passwordPromptParent)
{
if (m_cskPassword.isEmpty())
m_cskPassword = promptPassword(tr("Please provide your bbidtoken.csk PIN."));
m_cskPassword = promptPassword(tr("Please provide your bbidtoken.csk PIN."), passwordPromptParent);
return m_cskPassword;
}
QString BlackBerrySigningUtils::certificatePassword()
QString BlackBerrySigningUtils::certificatePassword(QWidget *passwordPromptParent)
{
if (m_certificatePassword.isEmpty())
m_certificatePassword = promptPassword(tr("Please enter your certificate password."));
m_certificatePassword = promptPassword(tr("Please enter your certificate password."), passwordPromptParent);
return m_certificatePassword;
}
......@@ -103,14 +103,14 @@ const BlackBerryCertificate * BlackBerrySigningUtils::defaultCertificate() const
return m_defaultCertificate;
}
void BlackBerrySigningUtils::openDefaultCertificate()
void BlackBerrySigningUtils::openDefaultCertificate(QWidget *passwordPromptParent)
{
if (m_defaultCertificate) {
emit defaultCertificateLoaded(BlackBerryCertificate::Success);
return;
}
const QString password = certificatePassword();
const QString password = certificatePassword(passwordPromptParent);
BlackBerryConfigurationManager &configManager = BlackBerryConfigurationManager::instance();
......@@ -165,9 +165,9 @@ void BlackBerrySigningUtils::certificateLoaded(int status)
emit defaultCertificateLoaded(status);
}
QString BlackBerrySigningUtils::promptPassword(const QString &message) const
QString BlackBerrySigningUtils::promptPassword(const QString &message, QWidget *dialogParent) const
{
QInputDialog dialog;
QInputDialog dialog(dialogParent);
dialog.setWindowTitle(tr("Qt Creator"));
dialog.setInputMode(QInputDialog::TextInput);
dialog.setLabelText(message);
......
......@@ -55,12 +55,12 @@ public:
bool hasLegacyKeys();
bool hasDefaultCertificate();
QString cskPassword();
QString certificatePassword();
QString cskPassword(QWidget *passwordPromptParent = 0);
QString certificatePassword(QWidget *passwordPromptParent = 0);
const BlackBerryCertificate *defaultCertificate() const;
void openDefaultCertificate();
void openDefaultCertificate(QWidget *passwordPromptParent = 0);
void setDefaultCertificate(BlackBerryCertificate *certificate);
void clearCskPassword();
void clearCertificatePassword();
......@@ -77,7 +77,7 @@ private:
BlackBerrySigningUtils(QObject *parent = 0);
QString promptPassword(const QString &message) const;
QString promptPassword(const QString &message, QWidget *dialogParent = 0) const;
BlackBerryCertificate *m_defaultCertificate;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment