Commit 491acf24 authored by Christian Kandeler's avatar Christian Kandeler

Maemo: Polish publishing wizard.

Task-number: QTCREATORBUG-4257
parent b5c1bf6a
......@@ -585,14 +585,17 @@ QStringList MaemoPublisherFremantleFree::findProblems() const
= qobject_cast<Qt4Maemo5Target *>(m_buildConfig->target());
const QString &description = target->shortDescription();
if (description.trimmed().isEmpty()) {
problems << tr("The package description is empty.");
problems << tr("The package description is empty. You must set one "
"in Projects -> Run -> Create Package -> Details.");
} else if (description.contains(QLatin1String("insert up to"))) {
problems << tr("The package description is '%1', which is probably "
"not what you want.").arg(description);
"not what you want. Please change it in "
"Projects -> Run -> Create Package -> Details.").arg(description);
}
QString dummy;
if (target->packageManagerIcon(&dummy).isNull())
problems << tr("You have not set an icon for the package manager.");
problems << tr("You have not set an icon for the package manager. "
"The icon must be set in Projects -> Run -> Create Package -> Details.");
return problems;
}
......
......@@ -87,6 +87,11 @@ void MaemoPublishingBuildSettingsPageFremantleFree::collectBuildConfigurations(c
}
}
void MaemoPublishingBuildSettingsPageFremantleFree::initializePage()
{
ui->skipUploadCheckBox->setChecked(true);
}
bool MaemoPublishingBuildSettingsPageFremantleFree::validatePage()
{
m_publisher->setBuildConfiguration(m_buildConfigs.at(ui->buildConfigComboBox->currentIndex()));
......
......@@ -61,6 +61,7 @@ public:
private:
Q_SLOT void handleNoUploadSettingChanged();
virtual void initializePage();
virtual bool validatePage();
void collectBuildConfigurations(const ProjectExplorer::Project *project);
bool skipUpload() const;
......
......@@ -49,8 +49,30 @@ MaemoPublishingUploadSettingsPageFremantleFree::MaemoPublishingUploadSettingsPag
ui(new Ui::MaemoPublishingUploadSettingsPageFremantleFree)
{
ui->setupUi(this);
ui->serverAddressLabel->hide();
ui->serverAddressLineEdit->hide();
ui->targetDirectoryOnServerLabel->hide();
ui->targetDirectoryOnServerLineEdit->hide();
setTitle(tr("Publishing to Fremantle's \"Extras-devel/free\" Repository"));
setSubTitle(tr("Upload options"));
connect(ui->garageAccountLineEdit, SIGNAL(textChanged(QString)),
SIGNAL(completeChanged()));
connect(ui->privateKeyPathChooser, SIGNAL(changed(QString)),
SIGNAL(completeChanged()));
connect(ui->serverAddressLineEdit, SIGNAL(textChanged(QString)),
SIGNAL(completeChanged()));
connect(ui->targetDirectoryOnServerLineEdit, SIGNAL(textChanged(QString)),
SIGNAL(completeChanged()));
}
MaemoPublishingUploadSettingsPageFremantleFree::~MaemoPublishingUploadSettingsPageFremantleFree()
{
delete ui;
}
void MaemoPublishingUploadSettingsPageFremantleFree::initializePage()
{
ui->garageAccountLineEdit->clear();
ui->privateKeyPathChooser->setExpectedKind(Utils::PathChooser::File);
ui->privateKeyPathChooser->setPromptDialogTitle(tr("Choose a private key file"));
ui->privateKeyPathChooser->setPath(QDir::toNativeSeparators(QDir::homePath() + QLatin1String("/.ssh/id_rsa")));
......@@ -58,16 +80,36 @@ MaemoPublishingUploadSettingsPageFremantleFree::MaemoPublishingUploadSettingsPag
ui->targetDirectoryOnServerLineEdit->setText(QLatin1String("/var/www/extras-devel/incoming-builder/fremantle/"));
}
MaemoPublishingUploadSettingsPageFremantleFree::~MaemoPublishingUploadSettingsPageFremantleFree()
bool MaemoPublishingUploadSettingsPageFremantleFree::isComplete() const
{
delete ui;
return !garageAccountName().isEmpty() && !privateKeyFilePath().isEmpty()
&& !serverName().isEmpty() && !directoryOnServer().isEmpty();
}
QString MaemoPublishingUploadSettingsPageFremantleFree::garageAccountName() const
{
return ui->garageAccountLineEdit->text().trimmed();
}
QString MaemoPublishingUploadSettingsPageFremantleFree::privateKeyFilePath() const
{
return ui->privateKeyPathChooser->path();
}
QString MaemoPublishingUploadSettingsPageFremantleFree::serverName() const
{
return ui->serverAddressLineEdit->text().trimmed();
}
QString MaemoPublishingUploadSettingsPageFremantleFree::directoryOnServer() const
{
return ui->targetDirectoryOnServerLineEdit->text().trimmed();
}
bool MaemoPublishingUploadSettingsPageFremantleFree::validatePage()
{
m_publisher->setSshParams(ui->serverAddressLineEdit->text(),
ui->garageAccountLineEdit->text(), ui->privateKeyPathChooser->path(),
ui->targetDirectoryOnServerLineEdit->text());
m_publisher->setSshParams(serverName(), garageAccountName(),
privateKeyFilePath(), directoryOnServer());
return true;
}
......
......@@ -55,8 +55,15 @@ public:
~MaemoPublishingUploadSettingsPageFremantleFree();
private:
virtual void initializePage();
virtual bool isComplete() const;
virtual bool validatePage();
QString garageAccountName() const;
QString privateKeyFilePath() const;
QString serverName() const;
QString directoryOnServer() const;
MaemoPublisherFremantleFree * const m_publisher;
Ui::MaemoPublishingUploadSettingsPageFremantleFree *ui;
};
......
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