forked from qt-creator/qt-creator
Wizards: use display names for supported platforms
The display names might be different form the internal string id. Change-Id: Ib2bf9d0ee2fbf87b2ba20a79e8b456830e7a940e Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
This commit is contained in:
@@ -271,14 +271,16 @@ void NewDialog::setWizards(QList<IWizard*> wizards)
|
||||
if (availablePlatforms.count() > 1) {
|
||||
m_ui->comboBox->addItem(tr("All templates"), QString());
|
||||
foreach (const QString &platform, availablePlatforms) {
|
||||
m_ui->comboBox->addItem(tr("%1 templates").arg(platform), platform);
|
||||
const QString displayNameForPlatform = IWizard::displayNameForPlatform(platform);
|
||||
m_ui->comboBox->addItem(tr("%1 templates").arg(displayNameForPlatform), platform);
|
||||
}
|
||||
} else {
|
||||
if (availablePlatforms.isEmpty()) {
|
||||
m_ui->comboBox->addItem(tr("All templates"), QString());
|
||||
} else {
|
||||
const QString platform = availablePlatforms.first();
|
||||
m_ui->comboBox->addItem(tr("%1 templates").arg(platform), platform);
|
||||
const QString displayNameForPlatform = IWizard::displayNameForPlatform(platform);
|
||||
m_ui->comboBox->addItem(tr("%1 templates").arg(displayNameForPlatform), platform);
|
||||
}
|
||||
m_ui->comboBox->setDisabled(true);
|
||||
}
|
||||
@@ -418,6 +420,9 @@ void NewDialog::currentItemChanged(const QModelIndex &index)
|
||||
QStandardItem* cat = (m_model->itemFromIndex(sourceIndex));
|
||||
if (const IWizard *wizard = wizardOfItem(cat)) {
|
||||
QString desciption = wizard->description();
|
||||
QStringList displayNamesForSupporttedPlatforms;
|
||||
foreach (const QString &platform, wizard->supportedPlatforms())
|
||||
displayNamesForSupporttedPlatforms << IWizard::displayNameForPlatform(platform);
|
||||
if (!Qt::mightBeRichText(desciption))
|
||||
desciption.replace(QLatin1Char('\n'), QLatin1String("<br>"));
|
||||
desciption += QLatin1String("<br><br><b>");
|
||||
@@ -426,7 +431,7 @@ void NewDialog::currentItemChanged(const QModelIndex &index)
|
||||
else
|
||||
desciption += tr("Supported Platforms")
|
||||
+ QLatin1String("</b>: <tt>")
|
||||
+ wizard->supportedPlatforms().join(QLatin1String(" "))
|
||||
+ displayNamesForSupporttedPlatforms.join(QLatin1String(" "))
|
||||
+ QLatin1String("</tt>");
|
||||
|
||||
m_ui->templateDescription->setHtml(desciption);
|
||||
|
||||
Reference in New Issue
Block a user