forked from qt-creator/qt-creator
Maemo: Harmattan application icons are now 80x80 pixels big.
Task-number: https://projects.maemo.org/bugzilla/show_bug.cgi?id=250237
This commit is contained in:
@@ -52,8 +52,12 @@ symbian {
|
||||
} else:unix {
|
||||
maemo5 {
|
||||
desktopfile.path = /usr/share/applications/hildon
|
||||
icon.files = $${TARGET}64.png
|
||||
icon.path = /usr/share/icons/hicolor/64x64/apps
|
||||
} else {
|
||||
desktopfile.path = /usr/share/applications
|
||||
icon.files = $${TARGET}80.png
|
||||
icon.path = /usr/share/icons/hicolor/80x80/apps
|
||||
copyCommand =
|
||||
for(deploymentfolder, DEPLOYMENTFOLDERS) {
|
||||
source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
|
||||
@@ -92,8 +96,6 @@ symbian {
|
||||
export($$itempath)
|
||||
INSTALLS += $$item
|
||||
}
|
||||
icon.files = $${TARGET}.png
|
||||
icon.path = /usr/share/icons/hicolor/64x64/apps
|
||||
desktopfile.files = $${TARGET}.desktop
|
||||
target.path = $${installPrefix}/bin
|
||||
export(icon.files)
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
BIN
share/qtcreator/templates/shared/maemoicon80.png
Normal file
BIN
share/qtcreator/templates/shared/maemoicon80.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.8 KiB |
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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('.')
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 if (isFremantleTargetSelected() || isMeegoTargetSelected())
|
||||
return m_maemoOptionsPageId;
|
||||
else
|
||||
return m_maemoOptionsPageId;
|
||||
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<Utils::WizardProgressItem *>() << m_genericItem << m_maemoItem << itemOfNextGenericPage());
|
||||
m_genericItem->setNextItems(QList<Utils::WizardProgressItem *>() << m_symbianItem << m_maemoItem);
|
||||
m_symbianItem->setNextItems(QList<Utils::WizardProgressItem *>() << m_maemoItem << itemOfNextGenericPage());
|
||||
m_targetItem->setNextItems(QList<Utils::WizardProgressItem *>()
|
||||
<< m_genericItem << m_maemoItem << m_harmattanItem << itemOfNextGenericPage());
|
||||
m_genericItem->setNextItems(QList<Utils::WizardProgressItem *>()
|
||||
<< m_symbianItem << m_maemoItem);
|
||||
m_symbianItem->setNextItems(QList<Utils::WizardProgressItem *>()
|
||||
<< 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<Utils::WizardProgressItem *> 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="appIconLabel">
|
||||
<property name="text">
|
||||
<string>Application icon (64x64):</string>
|
||||
<string>Application icon (%%w%%x%%h%%):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -56,7 +56,8 @@ bool QtQuickApp::generateFiles(QString *errorMessage) const
|
||||
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::AppViewerCppFile, errorMessage), path(AppViewerCpp))
|
||||
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::AppViewerHFile, errorMessage), path(AppViewerH))
|
||||
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::SymbianSvgIconFile, errorMessage), path(SymbianSvgIcon))
|
||||
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::MaemoPngIconFile, errorMessage), path(MaemoPngIcon))
|
||||
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::MaemoPngIconFile64, errorMessage), path(MaemoPngIcon64))
|
||||
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::MaemoPngIconFile80, errorMessage), path(MaemoPngIcon80))
|
||||
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::DesktopFile, errorMessage), path(Desktop));
|
||||
}
|
||||
|
||||
@@ -69,7 +70,8 @@ bool Html5App::generateFiles(QString *errorMessage) const
|
||||
&& writeFile(generateFile(Html5AppGeneratedFileInfo::AppViewerCppFile, errorMessage), path(AppViewerCpp))
|
||||
&& writeFile(generateFile(Html5AppGeneratedFileInfo::AppViewerHFile, errorMessage), path(AppViewerH))
|
||||
&& writeFile(generateFile(Html5AppGeneratedFileInfo::SymbianSvgIconFile, errorMessage), path(SymbianSvgIcon))
|
||||
&& writeFile(generateFile(Html5AppGeneratedFileInfo::MaemoPngIconFile, errorMessage), path(MaemoPngIcon))
|
||||
&& writeFile(generateFile(Html5AppGeneratedFileInfo::MaemoPngIconFile64, errorMessage), path(MaemoPngIcon64))
|
||||
&& writeFile(generateFile(Html5AppGeneratedFileInfo::MaemoPngIconFile80, errorMessage), path(MaemoPngIcon80))
|
||||
&& writeFile(generateFile(Html5AppGeneratedFileInfo::DesktopFile, errorMessage), path(Desktop));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user