Commit f86ccf29 authored by Pawel Polanski's avatar Pawel Polanski

Symbian: Application display name can be changed

When publishing to Ovi Store the application's
name can be changed in the Publishing Wizard

Task-number: QTCREATORBUG-4816
parent 4e254f2d
......@@ -103,6 +103,12 @@ void S60PublisherOvi::setBuildConfiguration(Qt4BuildConfiguration *qt4bc)
m_qt4bc = qt4bc;
}
void S60PublisherOvi::setDisplayName(const QString &displayName)
{
m_displayName = displayName;
}
void S60PublisherOvi::setVendorName(const QString &vendorName)
{
m_vendorName = vendorName;
......@@ -159,7 +165,6 @@ void S60PublisherOvi::completeCreation()
m_createSisProc->setWorkingDirectory(m_qt4bc->buildDirectory());
// set up access to vendor names
QStringList deploymentLevelVars = m_reader->values("DEPLOYMENT");
QStringList vendorInfoVars;
QStringList valueLevelVars;
......@@ -178,6 +183,24 @@ void S60PublisherOvi::completeCreation()
}
}
QString S60PublisherOvi::nameFromTarget() const
{
QString target = m_reader->value(QLatin1String("TARGET"));
if (target.isEmpty())
target = QFileInfo(m_qt4project->rootProjectNode()->path()).baseName();
return target;
}
QString S60PublisherOvi::displayName() const
{
const QStringList displayNameList = m_reader->values(QLatin1String("DEPLOYMENT.display_name"));
if (displayNameList.isEmpty())
return nameFromTarget();
return displayNameList.join(QLatin1String(" "));
}
QString S60PublisherOvi::globalVendorName() const
{
QStringList vendorinfos = m_reader->values(m_vendorInfoVariable);
......@@ -297,11 +320,14 @@ void S60PublisherOvi::updateProFile(const QString &var, const QString &values)
void S60PublisherOvi::updateProFile()
{
if (m_vendorInfoVariable.isEmpty()) {
m_vendorInfoVariable = "vendorinfo";
updateProFile("my_deployment.pkg_prerules", m_vendorInfoVariable);
updateProFile("DEPLOYMENT", "my_deployment");
m_vendorInfoVariable = QLatin1String("vendorinfo");
updateProFile(QLatin1String("my_deployment.pkg_prerules"), m_vendorInfoVariable);
updateProFile(QLatin1String("DEPLOYMENT"), QLatin1String("my_deployment"));
}
if (!m_displayName.isEmpty() && m_displayName != nameFromTarget())
updateProFile(QLatin1String("DEPLOYMENT.display_name"), m_displayName);
updateProFile(m_vendorInfoVariable, "\"%{" + m_localVendorNames + "}\" \":\\\"" + m_vendorName + "\\\"\"" );
updateProFile("TARGET.UID3", m_appUid);
}
......@@ -366,8 +392,6 @@ void S60PublisherOvi::endBuild(int result)
QString resultFile = m_qt4bc->buildDirectory() + "/" + m_qt4project->displayName() + fileNamePostFix;
QFileInfo fi(resultFile);
if (result == QProcess::NormalExit && fi.exists()) {
emit progressReport(tr("Created %1\n").arg(QDir::toNativeSeparators(resultFile)), m_normalColor);
......
......@@ -105,10 +105,12 @@ public:
void cleanUp();
void completeCreation();
QString displayName() const;
QString globalVendorName() const;
QString localisedVendorNames() const;
bool isVendorNameValid(const QString &vendorName) const;
QString nameFromTarget() const;
QString qtVersion() const;
QString uid3() const;
......@@ -128,10 +130,12 @@ public:
bool hasSucceeded();
void setDisplayName(const QString &displayName);
void setVendorName(const QString &vendorName);
void setLocalVendorNames(const QString &localVendorNames);
void setAppUid(const QString &appuid);
signals:
void progressReport(const QString& status, QColor c);
void succeeded();
......@@ -165,6 +169,7 @@ private:
QString m_vendorName;
QString m_localVendorNames;
QString m_appUid;
QString m_displayName;
bool m_finishedAndSuccessful;
};
......
......@@ -76,6 +76,11 @@ void S60PublishingSisSettingsPageOvi::initializePage()
showWarningsForUnenforcableChecks();
//Check Display Name
ui->displayNameLineEdit->setText(m_publisher->displayName());
displayNameChanged();
connect(ui->displayNameLineEdit,SIGNAL(textChanged(QString)),SLOT(displayNameChanged()));
//Check Global Vendor Name
ui->globalVendorNameLineEdit->setText(m_publisher->globalVendorName());
globalVendorNameChanged();
......@@ -131,6 +136,29 @@ void S60PublishingSisSettingsPageOvi::reflectSettingState(bool settingState, QLa
wizard()->setTitleFormat(wizard()->titleFormat());
}
void S60PublishingSisSettingsPageOvi::displayNameChanged()
{
reflectSettingState(!ui->displayNameLineEdit->text().isEmpty(),
ui->displayNameOkLabel,
ui->displayNameErrorLabel,
ui->displayNameErrorReasonLabel,
tr("This should be application's display name. <br>"
"It can't' be empty.<br>"));
const int visibleCharacters = 12;
if (ui->displayNameLineEdit->text().length() > visibleCharacters) {
ui->displayNameWarningLabel->show();
ui->displayNameWarningReasonLabel->setText(tr("The display name is quite long.<br>"
"It might not be fully visible in the phone's menu.<br>"));
ui->displayNameWarningReasonLabel->show();
} else {
ui->displayNameWarningLabel->hide();
ui->displayNameWarningReasonLabel->hide();
}
m_publisher->setDisplayName(ui->displayNameLineEdit->text());
}
void S60PublishingSisSettingsPageOvi::globalVendorNameChanged()
{
reflectSettingState(m_publisher->isVendorNameValid(ui->globalVendorNameLineEdit->text()),
......
......@@ -59,12 +59,14 @@ public:
virtual void initializePage();
virtual void cleanupPage();
private slots:
void globalVendorNameChanged();
void localisedVendorNamesChanged();
void qtVersionChanged();
void uid3Changed();
void capabilitiesChanged();
void displayNameChanged();
private:
void reflectSettingState(bool settingState, QLabel *okLabel, QLabel *errorLabel, QLabel *errorReasonLabel, const QString &errorReason);
......
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