diff options
-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: |