From 12b2a5fff0df1f20b117d3ad9ba4782ee944ccac Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 28 Apr 2011 15:11:42 +0200 Subject: Maemo: Harmattan application icons are now 80x80 pixels big. Task-number: https://projects.maemo.org/bugzilla/show_bug.cgi?id=250237 --- .../qt-maemo/maemodeployablelistmodel.cpp | 17 ++-- .../qt-maemo/maemodeployablelistmodel.h | 3 +- .../qt-maemo/maemodeployconfigurationwidget.cpp | 5 +- .../qt4projectmanager/qt-maemo/maemoglobal.cpp | 5 ++ .../qt4projectmanager/qt-maemo/maemoglobal.h | 1 + .../wizards/abstractmobileapp.cpp | 39 +++++++--- .../qt4projectmanager/wizards/abstractmobileapp.h | 18 +++-- .../wizards/abstractmobileappwizard.cpp | 91 ++++++++++++++-------- .../wizards/abstractmobileappwizard.h | 7 ++ .../wizards/mobileappwizardmaemooptionspage.ui | 2 +- .../wizards/mobileappwizardpages.cpp | 20 +++-- .../wizards/mobileappwizardpages.h | 3 +- 12 files changed, 146 insertions(+), 65 deletions(-) (limited to 'src') diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp index 1eafceacd2..f3d6b3a4a4 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp @@ -52,9 +52,6 @@ namespace Qt4ProjectManager { namespace Internal { -namespace { -const QLatin1String RemoteIconPath("/usr/share/icons/hicolor/64x64/apps"); -} // anonymous namespace MaemoDeployableListModel::MaemoDeployableListModel(const Qt4ProFileNode *proFileNode, ProFileUpdateSetting updateSetting, QObject *parent) @@ -269,7 +266,7 @@ bool MaemoDeployableListModel::addIcon(const QString &fileName) return true; const QString filesLine = QLatin1String("icon.files = ") + fileName; - const QString pathLine = QLatin1String("icon.path = ") + RemoteIconPath; + const QString pathLine = QLatin1String("icon.path = ") + remoteIconDir(); const QLatin1String installsLine("INSTALLS += icon"); if (!addLinesToProFile(QStringList() << filesLine << pathLine << installsLine)) @@ -278,7 +275,7 @@ bool MaemoDeployableListModel::addIcon(const QString &fileName) beginInsertRows(QModelIndex(), rowCount(), rowCount()); const QString filePath = QFileInfo(m_proFilePath).path() + QLatin1Char('/') + fileName; - m_deployables << MaemoDeployable(filePath, RemoteIconPath); + m_deployables << MaemoDeployable(filePath, remoteIconDir()); endInsertRows(); return true; } @@ -291,7 +288,7 @@ QString MaemoDeployableListModel::remoteIconFilePath() const foreach (const MaemoDeployable &d, m_deployables) { const QByteArray extension = QFileInfo(d.localFilePath).suffix().toLocal8Bit(); - if (d.remoteDir.startsWith(RemoteIconPath) + if (d.remoteDir.startsWith(remoteIconDir()) && imageTypes.contains(extension)) return d.remoteDir + QLatin1Char('/') + QFileInfo(d.localFilePath).fileName(); @@ -339,5 +336,13 @@ QString MaemoDeployableListModel::installPrefix() const return QLatin1String("/opt/") + m_projectName; } +QString MaemoDeployableListModel::remoteIconDir() const +{ + const QtVersion *const qv = qtVersion(); + QTC_ASSERT(qv, return QString()); + return QString::fromLocal8Bit("/usr/share/icons/hicolor/%1x%1/apps") + .arg(MaemoGlobal::applicationIconSize(MaemoGlobal::version(qv))); +} + } // namespace Qt4ProjectManager } // namespace Internal diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.h b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.h index cf9b07783a..88b4ee2dbc 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.h @@ -64,6 +64,7 @@ public: MaemoDeployable deployableAt(int row) const; bool isModified() const { return m_modified; } void setUnModified() { m_modified = false; } + const QtVersion *qtVersion() const; QString localExecutableFilePath() const; QString remoteExecutableFilePath() const; QString projectName() const { return m_projectName; } @@ -97,9 +98,9 @@ private: bool isEditable(const QModelIndex &index) const; bool buildModel(); bool addLinesToProFile(const QStringList &lines); - const QtVersion *qtVersion() const; QString proFileScope() const; QString installPrefix() const; + QString remoteIconDir() const; const Qt4ProjectType m_projectType; const QString m_proFilePath; diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeployconfigurationwidget.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodeployconfigurationwidget.cpp index ff5af3dc4e..c84ffe4c02 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeployconfigurationwidget.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeployconfigurationwidget.cpp @@ -133,8 +133,9 @@ void MaemoDeployConfigurationWidget::addIcon() MaemoDeployableListModel *const model = m_deployConfig->deployables()->modelAt(modelRow); + const int iconDim = MaemoGlobal::applicationIconSize(MaemoGlobal::version(model->qtVersion())); const QString origFilePath = QFileDialog::getOpenFileName(this, - tr("Choose Icon (will be scaled to 64x64 pixels, if necessary)"), + tr("Choose Icon (will be scaled to %1x%1 pixels, if necessary)").arg(iconDim), model->projectDir(), QLatin1String("(*.png)")); if (origFilePath.isEmpty()) return; @@ -144,7 +145,7 @@ void MaemoDeployConfigurationWidget::addIcon() tr("Unable to read image")); return; } - const QSize iconSize(64, 64); + const QSize iconSize(iconDim, iconDim); if (pixmap.size() != iconSize) pixmap = pixmap.scaled(iconSize); const QString newFileName = model->projectName() + QLatin1Char('.') diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp index c21c242f5e..315083dcb0 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp @@ -127,6 +127,11 @@ QString MaemoGlobal::devrootshPath() return QLatin1String("/usr/lib/mad-developer/devrootsh"); } +int MaemoGlobal::applicationIconSize(MaemoDeviceConfig::OsVersion osVersion) +{ + return osVersion == MaemoDeviceConfig::Maemo6 ? 80 : 64; +} + QString MaemoGlobal::remoteSudo(MaemoDeviceConfig::OsVersion osVersion, const QString &uname) { diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h index 65ee14a539..9a6925e597 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h @@ -83,6 +83,7 @@ public: static QString homeDirOnDevice(const QString &uname); static QString devrootshPath(); + static int applicationIconSize(MaemoDeviceConfig::OsVersion osVersion); static QString remoteSudo(MaemoDeviceConfig::OsVersion, const QString &uname); static QString remoteCommandPrefix(MaemoDeviceConfig::OsVersion osVersion, diff --git a/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp b/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp index f308711afc..b993bb13b3 100644 --- a/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp +++ b/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp @@ -115,14 +115,24 @@ QString AbstractMobileApp::symbianSvgIcon() const return path(SymbianSvgIconOrigin); } -void AbstractMobileApp::setMaemoPngIcon(const QString &icon) +void AbstractMobileApp::setMaemoPngIcon64(const QString &icon) { - m_maemoPngIcon = icon; + m_maemoPngIcon64 = icon; } -QString AbstractMobileApp::maemoPngIcon() const +QString AbstractMobileApp::maemoPngIcon64() const { - return path(MaemoPngIconOrigin); + return path(MaemoPngIconOrigin64); +} + +void AbstractMobileApp::setMaemoPngIcon80(const QString &icon) +{ + m_maemoPngIcon80 = icon; +} + +QString AbstractMobileApp::maemoPngIcon80() const +{ + return path(MaemoPngIconOrigin80); } void AbstractMobileApp::setSymbianTargetUid(const QString &uid) @@ -167,9 +177,12 @@ QString AbstractMobileApp::path(int fileType) const case SymbianSvgIcon: return outputPathBase() + cleanProjectName + QLatin1String(".svg"); case SymbianSvgIconOrigin: return !m_symbianSvgIcon.isEmpty() ? m_symbianSvgIcon : originsRootShared + symbianIconFileName; - case MaemoPngIcon: return outputPathBase() + cleanProjectName + QLatin1String(".png"); - case MaemoPngIconOrigin: return !m_maemoPngIcon.isEmpty() ? m_maemoPngIcon - : originsRootShared + QLatin1String("maemoicon.png"); + case MaemoPngIcon64: return outputPathBase() + cleanProjectName + QLatin1String("64.png"); + case MaemoPngIconOrigin64: return !m_maemoPngIcon64.isEmpty() ? m_maemoPngIcon64 + : originsRootShared + QLatin1String("maemoicon64.png"); + case MaemoPngIcon80: return outputPathBase() + cleanProjectName + QLatin1String("80.png"); + case MaemoPngIconOrigin80: return !m_maemoPngIcon80.isEmpty() ? m_maemoPngIcon80 + : originsRootShared + QLatin1String("maemoicon80.png"); default: return pathExtended(fileType); } return QString(); @@ -189,6 +202,8 @@ QByteArray AbstractMobileApp::generateDesktopFile(QString *errorMessage) const QByteArray desktopFileContent; if (!readTemplate(DesktopOrigin, &desktopFileContent, errorMessage)) return QByteArray(); + desktopFileContent.replace("Icon=thisApp", + "Icon=" + projectName().toUtf8() + "64"); return desktopFileContent.replace("thisApp", projectName().toUtf8()); } @@ -378,7 +393,8 @@ Core::GeneratedFiles AbstractMobileApp::generateFiles(QString *errorMessage) con files.last().setAttributes(Core::GeneratedFile::OpenProjectAttribute); files << file(generateFile(AbstractGeneratedFileInfo::MainCppFile, errorMessage), path(MainCpp)); files << file(generateFile(AbstractGeneratedFileInfo::SymbianSvgIconFile, errorMessage), path(SymbianSvgIcon)); - files << file(generateFile(AbstractGeneratedFileInfo::MaemoPngIconFile, errorMessage), path(MaemoPngIcon)); + files << file(generateFile(AbstractGeneratedFileInfo::MaemoPngIconFile64, errorMessage), path(MaemoPngIcon64)); + files << file(generateFile(AbstractGeneratedFileInfo::MaemoPngIconFile80, errorMessage), path(MaemoPngIcon80)); files << file(generateFile(AbstractGeneratedFileInfo::DesktopFile, errorMessage), path(Desktop)); return files; } @@ -415,8 +431,11 @@ QByteArray AbstractMobileApp::generateFile(int fileType, case AbstractGeneratedFileInfo::SymbianSvgIconFile: data = readBlob(path(SymbianSvgIconOrigin), errorMessage); break; - case AbstractGeneratedFileInfo::MaemoPngIconFile: - data = readBlob(path(MaemoPngIconOrigin), errorMessage); + case AbstractGeneratedFileInfo::MaemoPngIconFile64: + data = readBlob(path(MaemoPngIconOrigin64), errorMessage); + break; + case AbstractGeneratedFileInfo::MaemoPngIconFile80: + data = readBlob(path(MaemoPngIconOrigin80), errorMessage); break; case AbstractGeneratedFileInfo::DesktopFile: data = generateDesktopFile(errorMessage); diff --git a/src/plugins/qt4projectmanager/wizards/abstractmobileapp.h b/src/plugins/qt4projectmanager/wizards/abstractmobileapp.h index 9c5824e657..f3264f54ed 100644 --- a/src/plugins/qt4projectmanager/wizards/abstractmobileapp.h +++ b/src/plugins/qt4projectmanager/wizards/abstractmobileapp.h @@ -57,7 +57,8 @@ struct AppProFile, DeploymentPriFile, SymbianSvgIconFile, - MaemoPngIconFile, + MaemoPngIconFile64, + MaemoPngIconFile80, DesktopFile, ExtendedFile }; @@ -102,8 +103,10 @@ public: DeploymentPriOrigin, SymbianSvgIcon, SymbianSvgIconOrigin, - MaemoPngIcon, - MaemoPngIconOrigin, + MaemoPngIcon64, + MaemoPngIconOrigin64, + MaemoPngIcon80, + MaemoPngIconOrigin80, ExtendedFile }; @@ -116,8 +119,10 @@ public: void setProjectPath(const QString &path); void setSymbianSvgIcon(const QString &icon); QString symbianSvgIcon() const; - void setMaemoPngIcon(const QString &icon); - QString maemoPngIcon() const; + void setMaemoPngIcon64(const QString &icon); + QString maemoPngIcon64() const; + void setMaemoPngIcon80(const QString &icon); + QString maemoPngIcon80() const; void setSymbianTargetUid(const QString &uid); QString symbianTargetUid() const; void setNetworkEnabled(bool enabled); @@ -181,7 +186,8 @@ private: QString m_projectName; QFileInfo m_projectPath; QString m_symbianSvgIcon; - QString m_maemoPngIcon; + QString m_maemoPngIcon64; + QString m_maemoPngIcon80; QString m_symbianTargetUid; ScreenOrientation m_orientation; bool m_networkEnabled; diff --git a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp index ee4584ab96..45ad70691e 100644 --- a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp @@ -63,14 +63,18 @@ AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent, co m_symbianOptionsPage = new Internal::MobileAppWizardSymbianOptionsPage; m_symbianOptionsPageId = addPageWithTitle(m_symbianOptionsPage, QLatin1String(" ") + tr("Symbian Specific")); - m_maemoOptionsPage = new Internal::MobileAppWizardMaemoOptionsPage; + m_maemoOptionsPage = new Internal::MobileAppWizardMaemoOptionsPage(64); m_maemoOptionsPageId = addPageWithTitle(m_maemoOptionsPage, - QLatin1String(" ") + tr("Maemo Specific")); + QLatin1String(" ") + tr("Maemo5 And Meego Specific")); + m_harmattanOptionsPage = new Internal::MobileAppWizardMaemoOptionsPage(80); + m_harmattanOptionsPageId = addPageWithTitle(m_harmattanOptionsPage, + QLatin1String(" ") + tr("Harmattan Specific")); m_targetItem = wizardProgress()->item(m_targetsPageId); m_genericItem = wizardProgress()->item(m_genericOptionsPageId); m_symbianItem = wizardProgress()->item(m_symbianOptionsPageId); m_maemoItem = wizardProgress()->item(m_maemoOptionsPageId); + m_harmattanItem = wizardProgress()->item(m_harmattanOptionsPageId); m_targetItem->setNextShownItem(0); m_genericItem->setNextShownItem(0); @@ -91,30 +95,32 @@ int AbstractMobileAppWizardDialog::addPageWithTitle(QWizardPage *page, const QSt int AbstractMobileAppWizardDialog::nextId() const { - const bool symbianTargetSelected = - m_targetsPage->isTargetSelected(QLatin1String(Constants::S60_EMULATOR_TARGET_ID)) - || m_targetsPage->isTargetSelected(QLatin1String(Constants::S60_DEVICE_TARGET_ID)); - const bool fremantleTargetSelected - = m_targetsPage->isTargetSelected(QLatin1String(Constants::MAEMO5_DEVICE_TARGET_ID)); - const bool maemoTargetSelected = fremantleTargetSelected - || m_targetsPage->isTargetSelected(QLatin1String(Constants::HARMATTAN_DEVICE_TARGET_ID)) - || m_targetsPage->isTargetSelected(QLatin1String(Constants::MEEGO_DEVICE_TARGET_ID)); - if (currentPage() == m_targetsPage) { - if (symbianTargetSelected || fremantleTargetSelected) + if (isSymbianTargetSelected() || isFremantleTargetSelected()) return m_genericOptionsPageId; - else if (maemoTargetSelected) + else if (isMeegoTargetSelected()) return m_maemoOptionsPageId; + else if (isHarmattanTargetSelected()) + return m_harmattanOptionsPageId; else return idOfNextGenericPage(); } else if (currentPage() == m_genericOptionsPage) { - if (symbianTargetSelected) + if (isSymbianTargetSelected()) return m_symbianOptionsPageId; - else + else if (isFremantleTargetSelected() || isMeegoTargetSelected()) return m_maemoOptionsPageId; + else + return m_harmattanOptionsPageId; } else if (currentPage() == m_symbianOptionsPage) { - if (maemoTargetSelected) + if (isFremantleTargetSelected() || isMeegoTargetSelected()) return m_maemoOptionsPageId; + else if (isHarmattanTargetSelected()) + return m_harmattanOptionsPageId; + else + return idOfNextGenericPage(); + } else if (currentPage() == m_maemoOptionsPage) { + if (isHarmattanTargetSelected()) + return m_harmattanOptionsPageId; else return idOfNextGenericPage(); } else { @@ -125,24 +131,21 @@ int AbstractMobileAppWizardDialog::nextId() const void AbstractMobileAppWizardDialog::initializePage(int id) { if (id == startId()) { - m_targetItem->setNextItems(QList() << m_genericItem << m_maemoItem << itemOfNextGenericPage()); - m_genericItem->setNextItems(QList() << m_symbianItem << m_maemoItem); - m_symbianItem->setNextItems(QList() << m_maemoItem << itemOfNextGenericPage()); + m_targetItem->setNextItems(QList() + << m_genericItem << m_maemoItem << m_harmattanItem << itemOfNextGenericPage()); + m_genericItem->setNextItems(QList() + << m_symbianItem << m_maemoItem); + m_symbianItem->setNextItems(QList() + << m_maemoItem << m_harmattanItem << itemOfNextGenericPage()); } else if (id == m_genericOptionsPageId) { - const bool symbianTargetSelected = - m_targetsPage->isTargetSelected(QLatin1String(Constants::S60_EMULATOR_TARGET_ID)) - || m_targetsPage->isTargetSelected(QLatin1String(Constants::S60_DEVICE_TARGET_ID)); - const bool maemoTargetSelected = - m_targetsPage->isTargetSelected(QLatin1String(Constants::MAEMO5_DEVICE_TARGET_ID)) - || m_targetsPage->isTargetSelected(QLatin1String(Constants::HARMATTAN_DEVICE_TARGET_ID)) - || m_targetsPage->isTargetSelected(QLatin1String(Constants::MEEGO_DEVICE_TARGET_ID)); - QList order; order << m_genericItem; - if (symbianTargetSelected) + if (isSymbianTargetSelected()) order << m_symbianItem; - if (maemoTargetSelected) + if (isFremantleTargetSelected() || isMeegoTargetSelected()) order << m_maemoItem; + if (isHarmattanTargetSelected()) + order << m_harmattanItem; order << itemOfNextGenericPage(); for (int i = 0; i < order.count() - 1; i++) @@ -162,7 +165,7 @@ void AbstractMobileAppWizardDialog::cleanupPage(int id) int AbstractMobileAppWizardDialog::idOfNextGenericPage() const { - return pageIds().at(pageIds().indexOf(m_maemoOptionsPageId) + 1); + return pageIds().at(pageIds().indexOf(m_harmattanOptionsPageId) + 1); } Utils::WizardProgressItem *AbstractMobileAppWizardDialog::itemOfNextGenericPage() const @@ -170,6 +173,28 @@ Utils::WizardProgressItem *AbstractMobileAppWizardDialog::itemOfNextGenericPage( return wizardProgress()->item(idOfNextGenericPage()); } +bool AbstractMobileAppWizardDialog::isSymbianTargetSelected() const +{ + return m_targetsPage->isTargetSelected(QLatin1String(Constants::S60_EMULATOR_TARGET_ID)) + || m_targetsPage->isTargetSelected(QLatin1String(Constants::S60_DEVICE_TARGET_ID)); +} + +bool AbstractMobileAppWizardDialog::isFremantleTargetSelected() const +{ + return m_targetsPage->isTargetSelected(QLatin1String(Constants::MAEMO5_DEVICE_TARGET_ID)); +} + +bool AbstractMobileAppWizardDialog::isHarmattanTargetSelected() const +{ + return m_targetsPage->isTargetSelected(QLatin1String(Constants::HARMATTAN_DEVICE_TARGET_ID)); +} + +bool AbstractMobileAppWizardDialog::isMeegoTargetSelected() const +{ + return m_targetsPage->isTargetSelected(QLatin1String(Constants::MEEGO_DEVICE_TARGET_ID)); +} + + AbstractMobileAppWizard::AbstractMobileAppWizard(const Core::BaseFileWizardParameters ¶ms, QObject *parent) : Core::BaseFileWizard(params, parent) { @@ -185,7 +210,8 @@ QWizard *AbstractMobileAppWizard::createWizardDialog(QWidget *parent, wdlg->m_genericOptionsPage->setOrientation(app()->orientation()); wdlg->m_symbianOptionsPage->setSvgIcon(app()->symbianSvgIcon()); wdlg->m_symbianOptionsPage->setNetworkEnabled(app()->networkEnabled()); - wdlg->m_maemoOptionsPage->setPngIcon(app()->maemoPngIcon()); + wdlg->m_maemoOptionsPage->setPngIcon(app()->maemoPngIcon64()); + wdlg->m_harmattanOptionsPage->setPngIcon(app()->maemoPngIcon80()); connect(wdlg, SIGNAL(projectParametersChanged(QString, QString)), SLOT(useProjectPath(QString, QString))); foreach (QWizardPage *p, extensionPages) @@ -203,7 +229,8 @@ Core::GeneratedFiles AbstractMobileAppWizard::generateFiles(const QWizard *wizar app()->setSymbianTargetUid(wdlg->m_symbianOptionsPage->symbianUid()); app()->setSymbianSvgIcon(wdlg->m_symbianOptionsPage->svgIcon()); app()->setNetworkEnabled(wdlg->m_symbianOptionsPage->networkEnabled()); - app()->setMaemoPngIcon(wdlg->m_maemoOptionsPage->pngIcon()); + app()->setMaemoPngIcon64(wdlg->m_maemoOptionsPage->pngIcon()); + app()->setMaemoPngIcon80(wdlg->m_harmattanOptionsPage->pngIcon()); return app()->generateFiles(errorMessage); } diff --git a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.h b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.h index 276f05a3fe..7e75a3e1d6 100644 --- a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.h +++ b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.h @@ -71,20 +71,27 @@ private: int idOfNextGenericPage() const; Utils::WizardProgressItem *itemOfNextGenericPage() const; + bool isSymbianTargetSelected() const; + bool isFremantleTargetSelected() const; + bool isHarmattanTargetSelected() const; + bool isMeegoTargetSelected() const; Internal::MobileAppWizardGenericOptionsPage *m_genericOptionsPage; Internal::MobileAppWizardSymbianOptionsPage *m_symbianOptionsPage; Internal::MobileAppWizardMaemoOptionsPage *m_maemoOptionsPage; + Internal::MobileAppWizardMaemoOptionsPage *m_harmattanOptionsPage; TargetSetupPage *m_targetsPage; int m_genericOptionsPageId; int m_symbianOptionsPageId; int m_maemoOptionsPageId; + int m_harmattanOptionsPageId; int m_targetsPageId; Utils::WizardProgressItem *m_targetItem; Utils::WizardProgressItem *m_genericItem; Utils::WizardProgressItem *m_symbianItem; Utils::WizardProgressItem *m_maemoItem; + Utils::WizardProgressItem *m_harmattanItem; friend class AbstractMobileAppWizard; }; diff --git a/src/plugins/qt4projectmanager/wizards/mobileappwizardmaemooptionspage.ui b/src/plugins/qt4projectmanager/wizards/mobileappwizardmaemooptionspage.ui index 20f1f979d2..c21869d7cc 100644 --- a/src/plugins/qt4projectmanager/wizards/mobileappwizardmaemooptionspage.ui +++ b/src/plugins/qt4projectmanager/wizards/mobileappwizardmaemooptionspage.ui @@ -17,7 +17,7 @@ - Application icon (64x64): + Application icon (%%w%%x%%h%%): diff --git a/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.cpp b/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.cpp index cfe53d100c..285d0610c3 100644 --- a/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.cpp +++ b/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.cpp @@ -62,6 +62,7 @@ class MobileAppWizardSymbianOptionsPagePrivate class MobileAppWizardMaemoOptionsPagePrivate { Ui::MobileAppWizardMaemoOptionsPage ui; + QSize iconSize; QString pngIcon; friend class MobileAppWizardMaemoOptionsPage; }; @@ -166,11 +167,18 @@ void MobileAppWizardSymbianOptionsPage::openSvgIcon() } -MobileAppWizardMaemoOptionsPage::MobileAppWizardMaemoOptionsPage(QWidget *parent) +MobileAppWizardMaemoOptionsPage::MobileAppWizardMaemoOptionsPage(int appIconSize, + QWidget *parent) : QWizardPage(parent) , m_d(new MobileAppWizardMaemoOptionsPagePrivate) { m_d->ui.setupUi(this); + QString iconLabelText = m_d->ui.appIconLabel->text(); + iconLabelText.replace(QLatin1String("%%w%%"), QString::number(appIconSize)); + iconLabelText.replace(QLatin1String("%%h%%"), QString::number(appIconSize)); + m_d->ui.appIconLabel->setText(iconLabelText); + m_d->iconSize = QSize(appIconSize, appIconSize); + m_d->ui.pngIconButton->setIconSize(m_d->iconSize); connect(m_d->ui.pngIconButton, SIGNAL(clicked()), this, SLOT(openPngIcon())); } @@ -194,18 +202,18 @@ void MobileAppWizardMaemoOptionsPage::setPngIcon(const QString &icon) return; } - const QSize iconSize(64, 64); QString actualIconPath; - if (iconPixmap.size() == iconSize) { + if (iconPixmap.size() == m_d->iconSize) { actualIconPath = icon; } else { const QMessageBox::StandardButton button = QMessageBox::warning(this, - tr("Wrong Icon Size"), tr("The icon needs to be 64x64 pixels big, " - "but is not. Do you want Creator to scale it?"), + tr("Wrong Icon Size"), tr("The icon needs to be %1x%2 pixels big, " + "but is not. Do you want Creator to scale it?") + .arg(m_d->iconSize.width()).arg(m_d->iconSize.height()), QMessageBox::Ok | QMessageBox::Cancel); if (button != QMessageBox::Ok) return; - iconPixmap = iconPixmap.scaled(iconSize); + iconPixmap = iconPixmap.scaled(m_d->iconSize); Utils::TempFileSaver saver; saver.setAutoRemove(false); if (!saver.hasError()) diff --git a/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h b/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h index 1b75f14247..3ff8dbf459 100644 --- a/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h +++ b/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h @@ -85,7 +85,8 @@ class MobileAppWizardMaemoOptionsPage : public QWizardPage Q_DISABLE_COPY(MobileAppWizardMaemoOptionsPage) public: - explicit MobileAppWizardMaemoOptionsPage(QWidget *parent = 0); + explicit MobileAppWizardMaemoOptionsPage(int appIconSize, + QWidget *parent = 0); virtual ~MobileAppWizardMaemoOptionsPage(); QString pngIcon() const; -- cgit v1.2.1