Android: Use Utils::InfoLabel in CreateAndroidManifestWizard

Task-number: QTCREATORBUG-23346
Change-Id: I4d9049625e87bc8e770982fd10c59d8030774731
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
Alessandro Portale
2020-01-08 22:47:06 +01:00
parent 372014b843
commit 8a8efbd60d
2 changed files with 11 additions and 18 deletions

View File

@@ -38,7 +38,7 @@
#include <qtsupport/qtkitinformation.h>
#include <utils/utilsicons.h>
#include <utils/infolabel.h>
#include <QCheckBox>
#include <QComboBox>
@@ -123,22 +123,13 @@ ChooseDirectoryPage::ChooseDirectoryPage(CreateAndroidManifestWizard *wizard)
m_androidPackageSourceDir->setExpectedKind(PathChooser::Directory);
m_layout->addRow(tr("Android package source directory:"), m_androidPackageSourceDir);
m_sourceDirectoryWarning = new QLabel(this);
m_sourceDirectoryWarning =
new Utils::InfoLabel(tr("The Android package source directory cannot be the same as "
"the project directory."), Utils::InfoLabel::Error, this);
m_sourceDirectoryWarning->setVisible(false);
m_sourceDirectoryWarning->setText(tr("The Android package source directory cannot be the same as the project directory."));
m_sourceDirectoryWarning->setElideMode(Qt::ElideNone);
m_sourceDirectoryWarning->setWordWrap(true);
m_warningIcon = new QLabel(this);
m_warningIcon->setVisible(false);
m_warningIcon->setPixmap(Utils::Icons::CRITICAL.pixmap());
m_warningIcon->setWordWrap(true);
m_warningIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
auto hbox = new QHBoxLayout;
hbox->addWidget(m_warningIcon);
hbox->addWidget(m_sourceDirectoryWarning);
hbox->setAlignment(m_warningIcon, Qt::AlignTop);
m_layout->addRow(hbox);
m_layout->addRow(m_sourceDirectoryWarning);
connect(m_androidPackageSourceDir, &PathChooser::pathChanged,
m_wizard, &CreateAndroidManifestWizard::setDirectory);
@@ -163,7 +154,6 @@ void ChooseDirectoryPage::checkPackageSourceDir()
bool isComplete = QFileInfo(projectDir) != QFileInfo(newDir);
m_sourceDirectoryWarning->setVisible(!isComplete);
m_warningIcon->setVisible(!isComplete);
if (isComplete != m_complete) {
m_complete = isComplete;

View File

@@ -37,6 +37,10 @@ class QLabel;
class QFormLayout;
QT_END_NAMESPACE
namespace Utils {
class InfoLabel;
}
namespace ProjectExplorer { class Target; }
namespace Android {
@@ -78,8 +82,7 @@ private:
private:
CreateAndroidManifestWizard *m_wizard;
Utils::PathChooser *m_androidPackageSourceDir;
QLabel *m_sourceDirectoryWarning;
QLabel *m_warningIcon;
Utils::InfoLabel *m_sourceDirectoryWarning;
QLabel *m_label;
QFormLayout *m_layout;
bool m_complete;