diff options
author | Kevin Krammer <kevin.krammer.qnx@kdab.com> | 2012-10-04 17:40:46 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2012-10-05 09:56:06 +0200 |
commit | 4c562cdf198ea3796e31aeb53f51ab32383e527c (patch) | |
tree | 4bca3e08b61b1f05fb641f914b474ad1a24c41a7 /src | |
parent | 26ef19061c608ad9e080fce0cc4e8143865a8d54 (diff) |
QNX: fix image size checks in project wizard
Upcoming BlackBerry devices require larger icon/splashscreen sizes than
the ones the plugin code was originally created for.
Use place holders in error strings to avoid further string changes
on future size changes
Change-Id: I1065fa68eeba4e03a60fee85da6dbb8922160af8
Reviewed-by: Tobias Nätterlund <tobias.naetterlund@kdab.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/qnx/bardescriptorfileimagewizardpage.cpp | 48 |
1 files changed, 39 insertions, 9 deletions
diff --git a/src/plugins/qnx/bardescriptorfileimagewizardpage.cpp b/src/plugins/qnx/bardescriptorfileimagewizardpage.cpp index a915372b15..b2e6e47fd7 100644 --- a/src/plugins/qnx/bardescriptorfileimagewizardpage.cpp +++ b/src/plugins/qnx/bardescriptorfileimagewizardpage.cpp @@ -37,6 +37,30 @@ using namespace Qnx; using namespace Qnx::Internal; +namespace { + // image sizes are likely device specific. + // those are the ones for the upcoming BB10 devices which this plugin is mainly targetted at. + enum { + // Application icon sizes. + AppIconMinWidth = 1, + AppIconMinHeight = 1, + AppIconMaxWidth = 150, + AppIconMaxHeight = 150, + + // Landscape splashscreen sizes + LandscapeSplashMinWidth = 1, + LandscapeSplashMinHeight = 1, + LandscapeSplashMaxWidth = 1280, + LandscapeSplashMaxHeight = 768, + + // Portrait splashscreen sizes + PortraitSplashMinWidth = 1, + PortraitSplashMinHeight = 1, + PortraitSplashMaxWidth = 768, + PortraitSplashMaxHeight = 1280 + }; +} + BarDescriptorFileImageWizardPage::BarDescriptorFileImageWizardPage(QWidget *parent) : QWizardPage(parent) , m_ui(new Ui::BarDescriptorFileImageWizardPage) @@ -92,7 +116,7 @@ QString BarDescriptorFileImageWizardPage::portraitSplashScreen() const void BarDescriptorFileImageWizardPage::validateIcon(const QString &path) { - m_iconValidationResult = validateImage(path, QSize(1, 1), QSize(90, 90)); + m_iconValidationResult = validateImage(path, QSize(AppIconMinWidth, AppIconMinHeight), QSize(AppIconMaxWidth, AppIconMaxHeight)); switch (m_iconValidationResult) { case Valid: @@ -103,8 +127,10 @@ void BarDescriptorFileImageWizardPage::validateIcon(const QString &path) break; case IncorrectSize: { const QSize size = imageSize(path); - m_ui->iconValidationLabel->setText(tr("<font color=\"red\">Incorrect icon size (%1x%2). The recommended size is " - "86x86 pixels with a maximum size of 90x90 pixels.</font>").arg(size.width()).arg(size.height())); + m_ui->iconValidationLabel->setText(tr("<font color=\"red\">Incorrect icon size (%1x%2). The maximum size is " + "%3x%4 pixels.</font>") + .arg(size.width()).arg(size.height()) + .arg(AppIconMaxWidth).arg(AppIconMaxHeight)); break; } default: @@ -116,14 +142,14 @@ void BarDescriptorFileImageWizardPage::validateIcon(const QString &path) void BarDescriptorFileImageWizardPage::validateLandscapeSplashScreen(const QString &path) { - m_landscapeSplashScreenValidationResult = validateImage(path, QSize(1024, 600), QSize(1024, 600)); + m_landscapeSplashScreenValidationResult = validateImage(path, QSize(LandscapeSplashMinWidth, LandscapeSplashMinHeight), QSize(LandscapeSplashMaxWidth, LandscapeSplashMaxHeight)); updateSplashScreenValidationLabel(); emit completeChanged(); } void BarDescriptorFileImageWizardPage::validatePortraitSplashScreen(const QString &path) { - m_portraitSplashScreenValidationResult = validateImage(path, QSize(600, 1024), QSize(600, 1024)); + m_portraitSplashScreenValidationResult = validateImage(path, QSize(PortraitSplashMinWidth, PortraitSplashMinHeight), QSize(PortraitSplashMaxWidth, PortraitSplashMaxHeight)); updateSplashScreenValidationLabel(); emit completeChanged(); } @@ -143,8 +169,10 @@ void BarDescriptorFileImageWizardPage::updateSplashScreenValidationLabel() break; case IncorrectSize: { const QSize size = imageSize(m_ui->landscapeSplashScreen->fileName().toString()); - m_ui->splashScreenValidationLabel->setText(tr("<font color=\"red\">Incorrect landscape splash screen size (%1x%2). The required " - "size is 1024x600 pixels.</font>").arg(size.width()).arg(size.height())); + m_ui->splashScreenValidationLabel->setText(tr("<font color=\"red\">Incorrect landscape splash screen size (%1x%2). The maximum " + "size is %3x%4 pixels.</font>") + .arg(size.width()).arg(size.height()) + .arg(LandscapeSplashMaxWidth).arg(LandscapeSplashMaxHeight)); break; } case Valid: @@ -159,8 +187,10 @@ void BarDescriptorFileImageWizardPage::updateSplashScreenValidationLabel() break; case IncorrectSize: { const QSize size = imageSize(m_ui->portraitSplashScreen->fileName().toString()); - m_ui->splashScreenValidationLabel->setText(tr("<font color=\"red\">Incorrect portrait splash screen size (%1x%2). The required " - "size is 600x1024 pixels.</font>").arg(size.width()).arg(size.height())); + m_ui->splashScreenValidationLabel->setText(tr("<font color=\"red\">Incorrect portrait splash screen size (%1x%2). The maximum " + "size is %3x%4 pixels.</font>") + .arg(size.width()).arg(size.height()) + .arg(PortraitSplashMaxWidth).arg(PortraitSplashMaxHeight)); break; } case Valid: |