Commit 321a5614 authored by Robert Loehning's avatar Robert Loehning Committed by Daniel Teske

Fix issues in AndroidDeployQtWidget

- Use PathChooser
- Fix setting of CheckBox
- Fix button labels

Change-Id: I7acde4161370ff4c3d9a91b1175f3a3681fdea55
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 7c7d26da
......@@ -41,6 +41,8 @@
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <utils/fancylineedit.h>
#include <utils/pathchooser.h>
#include <QFileDialog>
......@@ -83,7 +85,12 @@ AndroidDeployQtWidget::AndroidDeployQtWidget(AndroidDeployQtStep *step)
// signing
m_ui->signPackageCheckBox->setChecked(m_step->signPackage());
m_ui->KeystoreLocationLineEdit->setText(m_step->keystorePath().toUserOutput());
m_ui->KeystoreLocationPathChooser->setExpectedKind(Utils::PathChooser::File);
m_ui->KeystoreLocationPathChooser->lineEdit()->setReadOnly(true);
m_ui->KeystoreLocationPathChooser->setPath(m_step->keystorePath().toUserOutput());
m_ui->KeystoreLocationPathChooser->setInitialBrowsePathBackup(QDir::homePath());
m_ui->KeystoreLocationPathChooser->setPromptDialogFilter(tr("Keystore files (*.keystore *.jks)"));
m_ui->KeystoreLocationPathChooser->setPromptDialogTitle(tr("Select keystore file"));
m_ui->signingDebugWarningIcon->hide();
m_ui->signingDebugWarningLabel->hide();
signPackageCheckBoxToggled(m_step->signPackage());
......@@ -116,8 +123,8 @@ AndroidDeployQtWidget::AndroidDeployQtWidget(AndroidDeployQtStep *step)
this, SLOT(signPackageCheckBoxToggled(bool)));
connect(m_ui->KeystoreCreatePushButton, SIGNAL(clicked()),
this, SLOT(createKeyStore()));
connect(m_ui->KeystoreLocationPushButton, SIGNAL(clicked()),
this, SLOT(browseKeyStore()));
connect(m_ui->KeystoreLocationPathChooser, SIGNAL(pathChanged(QString)),
SLOT(updateKeyStorePath(QString)));
connect(m_ui->certificatesAliasComboBox, SIGNAL(activated(QString)),
this, SLOT(certificatesAliasComboBoxActivated(QString)));
connect(m_ui->certificatesAliasComboBox, SIGNAL(currentIndexChanged(QString)),
......@@ -269,7 +276,7 @@ void AndroidDeployQtWidget::createKeyStore()
AndroidCreateKeystoreCertificate d;
if (d.exec() != QDialog::Accepted)
return;
m_ui->KeystoreLocationLineEdit->setText(d.keystoreFilePath().toUserOutput());
m_ui->KeystoreLocationPathChooser->setPath(d.keystoreFilePath().toUserOutput());
m_step->setKeystorePath(d.keystoreFilePath());
m_step->setKeystorePassword(d.keystorePassword());
m_step->setCertificateAlias(d.certificateAlias());
......@@ -284,17 +291,11 @@ void AndroidDeployQtWidget::setCertificates()
m_ui->certificatesAliasComboBox->setModel(certificates);
}
void AndroidDeployQtWidget::browseKeyStore()
void AndroidDeployQtWidget::updateKeyStorePath(const QString &path)
{
Utils::FileName keystorePath = m_step->keystorePath();
if (keystorePath.isEmpty())
keystorePath = Utils::FileName::fromString(QDir::homePath());
Utils::FileName file = Utils::FileName::fromString(QFileDialog::getOpenFileName(this, tr("Select keystore file"), keystorePath.toString(), tr("Keystore files (*.keystore *.jks)")));
if (file.isEmpty())
return;
m_ui->KeystoreLocationLineEdit->setText(file.toUserOutput());
Utils::FileName file = Utils::FileName::fromString(path);
m_step->setKeystorePath(file);
m_ui->signPackageCheckBox->setChecked(false);
m_ui->signPackageCheckBox->setChecked(!file.isEmpty());
}
void AndroidDeployQtWidget::certificatesAliasComboBoxActivated(const QString &alias)
......
......@@ -67,7 +67,7 @@ private slots:
void updateSigningWarning();
void openPackageLocationCheckBoxToggled(bool checked);
void verboseOutputCheckBoxToggled(bool checked);
void browseKeyStore();
void updateKeyStorePath(const QString &path);
void signPackageCheckBoxToggled(bool checked);
void updateInputFileUi();
void inputFileComboBoxIndexChanged();
......
......@@ -33,23 +33,12 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="KeystoreLocationLineEdit">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
<widget class="Utils::PathChooser" name="KeystoreLocationPathChooser" native="true"/>
</item>
<item>
<widget class="QPushButton" name="KeystoreCreatePushButton">
<property name="text">
<string>Create</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="KeystoreLocationPushButton">
<property name="text">
<string>Browse</string>
<string>Create...</string>
</property>
</widget>
</item>
......@@ -338,7 +327,7 @@ The APK will not be usable on any other device.</string>
<string>Select library to include in package.</string>
</property>
<property name="text">
<string>Add</string>
<string>Add...</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextOnly</enum>
......@@ -377,6 +366,14 @@ The APK will not be usable on any other device.</string>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Utils::PathChooser</class>
<extends>QWidget</extends>
<header location="global">utils/pathchooser.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../projectexplorer/projectexplorer.qrc"/>
</resources>
......
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