diff options
author | El Mehdi Fekari <mfekari@rim.com> | 2013-04-09 14:32:39 +0200 |
---|---|---|
committer | Rafael Roquetto <rafael.roquetto@kdab.com> | 2013-04-16 22:50:33 +0200 |
commit | c6449e55ff30ed746189560e3e86fc8e7ada006f (patch) | |
tree | e4f26ee3981c889cad9d5d904e840614af9ff819 /src/plugins/qnx/blackberrydebugtokenrequestdialog.cpp | |
parent | 8b07cc395d598447f5f206be7fbd117971b89e8f (diff) | |
download | qt-creator-c6449e55ff30ed746189560e3e86fc8e7ada006f.tar.gz |
Qnx: Auto detect device PIN when requesting debugToken
Task-number: QTCREATORBUG-9062
Change-Id: Ib6bc2f2da6f6cfe9e78eb1d9d7e9d8f6abbd9948
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Diffstat (limited to 'src/plugins/qnx/blackberrydebugtokenrequestdialog.cpp')
-rw-r--r-- | src/plugins/qnx/blackberrydebugtokenrequestdialog.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/plugins/qnx/blackberrydebugtokenrequestdialog.cpp b/src/plugins/qnx/blackberrydebugtokenrequestdialog.cpp index 22b60051b2..e79423021f 100644 --- a/src/plugins/qnx/blackberrydebugtokenrequestdialog.cpp +++ b/src/plugins/qnx/blackberrydebugtokenrequestdialog.cpp @@ -31,6 +31,7 @@ #include "blackberrydebugtokenrequestdialog.h" #include "blackberrydebugtokenrequester.h" +#include "blackberrydeviceinformation.h" #include "blackberryconfiguration.h" #include "blackberrycertificate.h" #include "ui_blackberrydebugtokenrequestdialog.h" @@ -46,7 +47,8 @@ BlackBerryDebugTokenRequestDialog::BlackBerryDebugTokenRequestDialog( QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f), m_ui(new Ui_BlackBerryDebugTokenRequestDialog), - m_requester(new BlackBerryDebugTokenRequester) + m_requester(new BlackBerryDebugTokenRequester(this)), + m_deviceInfo(new BlackBerryDeviceInformation(this)) { m_ui->setupUi(this); m_ui->progressBar->hide(); @@ -83,6 +85,13 @@ BlackBerryDebugTokenRequestDialog::BlackBerryDebugTokenRequestDialog( this, SLOT(checkBoxChanged(int))); connect(m_requester, SIGNAL(finished(int)), this, SLOT(debugTokenArrived(int))); + connect(m_deviceInfo, SIGNAL(finished(int)), + this, SLOT(setDevicePin(int))); +} + +BlackBerryDebugTokenRequestDialog::~BlackBerryDebugTokenRequestDialog() +{ + delete m_ui; } QString BlackBerryDebugTokenRequestDialog::debugToken() const @@ -90,6 +99,12 @@ QString BlackBerryDebugTokenRequestDialog::debugToken() const return m_ui->debugTokenPath->path(); } +void BlackBerryDebugTokenRequestDialog::setTargetDetails(const QString &deviceIp, const QString &password) +{ + m_ui->devicePin->setPlaceholderText(tr("Requesting Device PIN...")); + m_deviceInfo->setDeviceTarget(deviceIp, password); +} + void BlackBerryDebugTokenRequestDialog::validate() { if (!m_ui->debugTokenPath->isValid() @@ -232,6 +247,19 @@ void BlackBerryDebugTokenRequestDialog::debugTokenArrived(int status) setBusy(false); } +void BlackBerryDebugTokenRequestDialog::setDevicePin(int status) +{ + m_ui->devicePin->setPlaceholderText(QString()); + if (status != BlackBerryDeviceInformation::Success) + return; + + const QString devicePin = m_deviceInfo->devicePin(); + if (devicePin.isEmpty()) + return; + + m_ui->devicePin->setText(devicePin); +} + void BlackBerryDebugTokenRequestDialog::setBusy(bool busy) { m_okButton->setEnabled(!busy); |