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 {
|
} else:unix {
|
||||||
maemo5 {
|
maemo5 {
|
||||||
desktopfile.path = /usr/share/applications/hildon
|
desktopfile.path = /usr/share/applications/hildon
|
||||||
|
icon.files = $${TARGET}64.png
|
||||||
|
icon.path = /usr/share/icons/hicolor/64x64/apps
|
||||||
} else {
|
} else {
|
||||||
desktopfile.path = /usr/share/applications
|
desktopfile.path = /usr/share/applications
|
||||||
|
icon.files = $${TARGET}80.png
|
||||||
|
icon.path = /usr/share/icons/hicolor/80x80/apps
|
||||||
copyCommand =
|
copyCommand =
|
||||||
for(deploymentfolder, DEPLOYMENTFOLDERS) {
|
for(deploymentfolder, DEPLOYMENTFOLDERS) {
|
||||||
source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
|
source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
|
||||||
@@ -92,8 +96,6 @@ symbian {
|
|||||||
export($$itempath)
|
export($$itempath)
|
||||||
INSTALLS += $$item
|
INSTALLS += $$item
|
||||||
}
|
}
|
||||||
icon.files = $${TARGET}.png
|
|
||||||
icon.path = /usr/share/icons/hicolor/64x64/apps
|
|
||||||
desktopfile.files = $${TARGET}.desktop
|
desktopfile.files = $${TARGET}.desktop
|
||||||
target.path = $${installPrefix}/bin
|
target.path = $${installPrefix}/bin
|
||||||
export(icon.files)
|
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 Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
namespace {
|
|
||||||
const QLatin1String RemoteIconPath("/usr/share/icons/hicolor/64x64/apps");
|
|
||||||
} // anonymous namespace
|
|
||||||
|
|
||||||
MaemoDeployableListModel::MaemoDeployableListModel(const Qt4ProFileNode *proFileNode,
|
MaemoDeployableListModel::MaemoDeployableListModel(const Qt4ProFileNode *proFileNode,
|
||||||
ProFileUpdateSetting updateSetting, QObject *parent)
|
ProFileUpdateSetting updateSetting, QObject *parent)
|
||||||
@@ -269,7 +266,7 @@ bool MaemoDeployableListModel::addIcon(const QString &fileName)
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
const QString filesLine = QLatin1String("icon.files = ") + fileName;
|
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");
|
const QLatin1String installsLine("INSTALLS += icon");
|
||||||
if (!addLinesToProFile(QStringList() << filesLine << pathLine
|
if (!addLinesToProFile(QStringList() << filesLine << pathLine
|
||||||
<< installsLine))
|
<< installsLine))
|
||||||
@@ -278,7 +275,7 @@ bool MaemoDeployableListModel::addIcon(const QString &fileName)
|
|||||||
beginInsertRows(QModelIndex(), rowCount(), rowCount());
|
beginInsertRows(QModelIndex(), rowCount(), rowCount());
|
||||||
const QString filePath = QFileInfo(m_proFilePath).path()
|
const QString filePath = QFileInfo(m_proFilePath).path()
|
||||||
+ QLatin1Char('/') + fileName;
|
+ QLatin1Char('/') + fileName;
|
||||||
m_deployables << MaemoDeployable(filePath, RemoteIconPath);
|
m_deployables << MaemoDeployable(filePath, remoteIconDir());
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -291,7 +288,7 @@ QString MaemoDeployableListModel::remoteIconFilePath() const
|
|||||||
foreach (const MaemoDeployable &d, m_deployables) {
|
foreach (const MaemoDeployable &d, m_deployables) {
|
||||||
const QByteArray extension
|
const QByteArray extension
|
||||||
= QFileInfo(d.localFilePath).suffix().toLocal8Bit();
|
= QFileInfo(d.localFilePath).suffix().toLocal8Bit();
|
||||||
if (d.remoteDir.startsWith(RemoteIconPath)
|
if (d.remoteDir.startsWith(remoteIconDir())
|
||||||
&& imageTypes.contains(extension))
|
&& imageTypes.contains(extension))
|
||||||
return d.remoteDir + QLatin1Char('/')
|
return d.remoteDir + QLatin1Char('/')
|
||||||
+ QFileInfo(d.localFilePath).fileName();
|
+ QFileInfo(d.localFilePath).fileName();
|
||||||
@@ -339,5 +336,13 @@ QString MaemoDeployableListModel::installPrefix() const
|
|||||||
return QLatin1String("/opt/") + m_projectName;
|
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 Qt4ProjectManager
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ public:
|
|||||||
MaemoDeployable deployableAt(int row) const;
|
MaemoDeployable deployableAt(int row) const;
|
||||||
bool isModified() const { return m_modified; }
|
bool isModified() const { return m_modified; }
|
||||||
void setUnModified() { m_modified = false; }
|
void setUnModified() { m_modified = false; }
|
||||||
|
const QtVersion *qtVersion() const;
|
||||||
QString localExecutableFilePath() const;
|
QString localExecutableFilePath() const;
|
||||||
QString remoteExecutableFilePath() const;
|
QString remoteExecutableFilePath() const;
|
||||||
QString projectName() const { return m_projectName; }
|
QString projectName() const { return m_projectName; }
|
||||||
@@ -97,9 +98,9 @@ private:
|
|||||||
bool isEditable(const QModelIndex &index) const;
|
bool isEditable(const QModelIndex &index) const;
|
||||||
bool buildModel();
|
bool buildModel();
|
||||||
bool addLinesToProFile(const QStringList &lines);
|
bool addLinesToProFile(const QStringList &lines);
|
||||||
const QtVersion *qtVersion() const;
|
|
||||||
QString proFileScope() const;
|
QString proFileScope() const;
|
||||||
QString installPrefix() const;
|
QString installPrefix() const;
|
||||||
|
QString remoteIconDir() const;
|
||||||
|
|
||||||
const Qt4ProjectType m_projectType;
|
const Qt4ProjectType m_projectType;
|
||||||
const QString m_proFilePath;
|
const QString m_proFilePath;
|
||||||
|
|||||||
@@ -133,8 +133,9 @@ void MaemoDeployConfigurationWidget::addIcon()
|
|||||||
|
|
||||||
MaemoDeployableListModel *const model
|
MaemoDeployableListModel *const model
|
||||||
= m_deployConfig->deployables()->modelAt(modelRow);
|
= m_deployConfig->deployables()->modelAt(modelRow);
|
||||||
|
const int iconDim = MaemoGlobal::applicationIconSize(MaemoGlobal::version(model->qtVersion()));
|
||||||
const QString origFilePath = QFileDialog::getOpenFileName(this,
|
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)"));
|
model->projectDir(), QLatin1String("(*.png)"));
|
||||||
if (origFilePath.isEmpty())
|
if (origFilePath.isEmpty())
|
||||||
return;
|
return;
|
||||||
@@ -144,7 +145,7 @@ void MaemoDeployConfigurationWidget::addIcon()
|
|||||||
tr("Unable to read image"));
|
tr("Unable to read image"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const QSize iconSize(64, 64);
|
const QSize iconSize(iconDim, iconDim);
|
||||||
if (pixmap.size() != iconSize)
|
if (pixmap.size() != iconSize)
|
||||||
pixmap = pixmap.scaled(iconSize);
|
pixmap = pixmap.scaled(iconSize);
|
||||||
const QString newFileName = model->projectName() + QLatin1Char('.')
|
const QString newFileName = model->projectName() + QLatin1Char('.')
|
||||||
|
|||||||
@@ -127,6 +127,11 @@ QString MaemoGlobal::devrootshPath()
|
|||||||
return QLatin1String("/usr/lib/mad-developer/devrootsh");
|
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,
|
QString MaemoGlobal::remoteSudo(MaemoDeviceConfig::OsVersion osVersion,
|
||||||
const QString &uname)
|
const QString &uname)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ public:
|
|||||||
|
|
||||||
static QString homeDirOnDevice(const QString &uname);
|
static QString homeDirOnDevice(const QString &uname);
|
||||||
static QString devrootshPath();
|
static QString devrootshPath();
|
||||||
|
static int applicationIconSize(MaemoDeviceConfig::OsVersion osVersion);
|
||||||
static QString remoteSudo(MaemoDeviceConfig::OsVersion,
|
static QString remoteSudo(MaemoDeviceConfig::OsVersion,
|
||||||
const QString &uname);
|
const QString &uname);
|
||||||
static QString remoteCommandPrefix(MaemoDeviceConfig::OsVersion osVersion,
|
static QString remoteCommandPrefix(MaemoDeviceConfig::OsVersion osVersion,
|
||||||
|
|||||||
@@ -115,14 +115,24 @@ QString AbstractMobileApp::symbianSvgIcon() const
|
|||||||
return path(SymbianSvgIconOrigin);
|
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)
|
void AbstractMobileApp::setSymbianTargetUid(const QString &uid)
|
||||||
@@ -167,9 +177,12 @@ QString AbstractMobileApp::path(int fileType) const
|
|||||||
case SymbianSvgIcon: return outputPathBase() + cleanProjectName + QLatin1String(".svg");
|
case SymbianSvgIcon: return outputPathBase() + cleanProjectName + QLatin1String(".svg");
|
||||||
case SymbianSvgIconOrigin: return !m_symbianSvgIcon.isEmpty() ? m_symbianSvgIcon
|
case SymbianSvgIconOrigin: return !m_symbianSvgIcon.isEmpty() ? m_symbianSvgIcon
|
||||||
: originsRootShared + symbianIconFileName;
|
: originsRootShared + symbianIconFileName;
|
||||||
case MaemoPngIcon: return outputPathBase() + cleanProjectName + QLatin1String(".png");
|
case MaemoPngIcon64: return outputPathBase() + cleanProjectName + QLatin1String("64.png");
|
||||||
case MaemoPngIconOrigin: return !m_maemoPngIcon.isEmpty() ? m_maemoPngIcon
|
case MaemoPngIconOrigin64: return !m_maemoPngIcon64.isEmpty() ? m_maemoPngIcon64
|
||||||
: originsRootShared + QLatin1String("maemoicon.png");
|
: 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);
|
default: return pathExtended(fileType);
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
@@ -189,6 +202,8 @@ QByteArray AbstractMobileApp::generateDesktopFile(QString *errorMessage) const
|
|||||||
QByteArray desktopFileContent;
|
QByteArray desktopFileContent;
|
||||||
if (!readTemplate(DesktopOrigin, &desktopFileContent, errorMessage))
|
if (!readTemplate(DesktopOrigin, &desktopFileContent, errorMessage))
|
||||||
return QByteArray();
|
return QByteArray();
|
||||||
|
desktopFileContent.replace("Icon=thisApp",
|
||||||
|
"Icon=" + projectName().toUtf8() + "64");
|
||||||
return desktopFileContent.replace("thisApp", projectName().toUtf8());
|
return desktopFileContent.replace("thisApp", projectName().toUtf8());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -378,7 +393,8 @@ Core::GeneratedFiles AbstractMobileApp::generateFiles(QString *errorMessage) con
|
|||||||
files.last().setAttributes(Core::GeneratedFile::OpenProjectAttribute);
|
files.last().setAttributes(Core::GeneratedFile::OpenProjectAttribute);
|
||||||
files << file(generateFile(AbstractGeneratedFileInfo::MainCppFile, errorMessage), path(MainCpp));
|
files << file(generateFile(AbstractGeneratedFileInfo::MainCppFile, errorMessage), path(MainCpp));
|
||||||
files << file(generateFile(AbstractGeneratedFileInfo::SymbianSvgIconFile, errorMessage), path(SymbianSvgIcon));
|
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));
|
files << file(generateFile(AbstractGeneratedFileInfo::DesktopFile, errorMessage), path(Desktop));
|
||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
@@ -415,8 +431,11 @@ QByteArray AbstractMobileApp::generateFile(int fileType,
|
|||||||
case AbstractGeneratedFileInfo::SymbianSvgIconFile:
|
case AbstractGeneratedFileInfo::SymbianSvgIconFile:
|
||||||
data = readBlob(path(SymbianSvgIconOrigin), errorMessage);
|
data = readBlob(path(SymbianSvgIconOrigin), errorMessage);
|
||||||
break;
|
break;
|
||||||
case AbstractGeneratedFileInfo::MaemoPngIconFile:
|
case AbstractGeneratedFileInfo::MaemoPngIconFile64:
|
||||||
data = readBlob(path(MaemoPngIconOrigin), errorMessage);
|
data = readBlob(path(MaemoPngIconOrigin64), errorMessage);
|
||||||
|
break;
|
||||||
|
case AbstractGeneratedFileInfo::MaemoPngIconFile80:
|
||||||
|
data = readBlob(path(MaemoPngIconOrigin80), errorMessage);
|
||||||
break;
|
break;
|
||||||
case AbstractGeneratedFileInfo::DesktopFile:
|
case AbstractGeneratedFileInfo::DesktopFile:
|
||||||
data = generateDesktopFile(errorMessage);
|
data = generateDesktopFile(errorMessage);
|
||||||
|
|||||||
@@ -57,7 +57,8 @@ struct
|
|||||||
AppProFile,
|
AppProFile,
|
||||||
DeploymentPriFile,
|
DeploymentPriFile,
|
||||||
SymbianSvgIconFile,
|
SymbianSvgIconFile,
|
||||||
MaemoPngIconFile,
|
MaemoPngIconFile64,
|
||||||
|
MaemoPngIconFile80,
|
||||||
DesktopFile,
|
DesktopFile,
|
||||||
ExtendedFile
|
ExtendedFile
|
||||||
};
|
};
|
||||||
@@ -102,8 +103,10 @@ public:
|
|||||||
DeploymentPriOrigin,
|
DeploymentPriOrigin,
|
||||||
SymbianSvgIcon,
|
SymbianSvgIcon,
|
||||||
SymbianSvgIconOrigin,
|
SymbianSvgIconOrigin,
|
||||||
MaemoPngIcon,
|
MaemoPngIcon64,
|
||||||
MaemoPngIconOrigin,
|
MaemoPngIconOrigin64,
|
||||||
|
MaemoPngIcon80,
|
||||||
|
MaemoPngIconOrigin80,
|
||||||
ExtendedFile
|
ExtendedFile
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -116,8 +119,10 @@ public:
|
|||||||
void setProjectPath(const QString &path);
|
void setProjectPath(const QString &path);
|
||||||
void setSymbianSvgIcon(const QString &icon);
|
void setSymbianSvgIcon(const QString &icon);
|
||||||
QString symbianSvgIcon() const;
|
QString symbianSvgIcon() const;
|
||||||
void setMaemoPngIcon(const QString &icon);
|
void setMaemoPngIcon64(const QString &icon);
|
||||||
QString maemoPngIcon() const;
|
QString maemoPngIcon64() const;
|
||||||
|
void setMaemoPngIcon80(const QString &icon);
|
||||||
|
QString maemoPngIcon80() const;
|
||||||
void setSymbianTargetUid(const QString &uid);
|
void setSymbianTargetUid(const QString &uid);
|
||||||
QString symbianTargetUid() const;
|
QString symbianTargetUid() const;
|
||||||
void setNetworkEnabled(bool enabled);
|
void setNetworkEnabled(bool enabled);
|
||||||
@@ -181,7 +186,8 @@ private:
|
|||||||
QString m_projectName;
|
QString m_projectName;
|
||||||
QFileInfo m_projectPath;
|
QFileInfo m_projectPath;
|
||||||
QString m_symbianSvgIcon;
|
QString m_symbianSvgIcon;
|
||||||
QString m_maemoPngIcon;
|
QString m_maemoPngIcon64;
|
||||||
|
QString m_maemoPngIcon80;
|
||||||
QString m_symbianTargetUid;
|
QString m_symbianTargetUid;
|
||||||
ScreenOrientation m_orientation;
|
ScreenOrientation m_orientation;
|
||||||
bool m_networkEnabled;
|
bool m_networkEnabled;
|
||||||
|
|||||||
@@ -63,14 +63,18 @@ AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent, co
|
|||||||
m_symbianOptionsPage = new Internal::MobileAppWizardSymbianOptionsPage;
|
m_symbianOptionsPage = new Internal::MobileAppWizardSymbianOptionsPage;
|
||||||
m_symbianOptionsPageId = addPageWithTitle(m_symbianOptionsPage,
|
m_symbianOptionsPageId = addPageWithTitle(m_symbianOptionsPage,
|
||||||
QLatin1String(" ") + tr("Symbian Specific"));
|
QLatin1String(" ") + tr("Symbian Specific"));
|
||||||
m_maemoOptionsPage = new Internal::MobileAppWizardMaemoOptionsPage;
|
m_maemoOptionsPage = new Internal::MobileAppWizardMaemoOptionsPage(64);
|
||||||
m_maemoOptionsPageId = addPageWithTitle(m_maemoOptionsPage,
|
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_targetItem = wizardProgress()->item(m_targetsPageId);
|
||||||
m_genericItem = wizardProgress()->item(m_genericOptionsPageId);
|
m_genericItem = wizardProgress()->item(m_genericOptionsPageId);
|
||||||
m_symbianItem = wizardProgress()->item(m_symbianOptionsPageId);
|
m_symbianItem = wizardProgress()->item(m_symbianOptionsPageId);
|
||||||
m_maemoItem = wizardProgress()->item(m_maemoOptionsPageId);
|
m_maemoItem = wizardProgress()->item(m_maemoOptionsPageId);
|
||||||
|
m_harmattanItem = wizardProgress()->item(m_harmattanOptionsPageId);
|
||||||
|
|
||||||
m_targetItem->setNextShownItem(0);
|
m_targetItem->setNextShownItem(0);
|
||||||
m_genericItem->setNextShownItem(0);
|
m_genericItem->setNextShownItem(0);
|
||||||
@@ -91,30 +95,32 @@ int AbstractMobileAppWizardDialog::addPageWithTitle(QWizardPage *page, const QSt
|
|||||||
|
|
||||||
int AbstractMobileAppWizardDialog::nextId() const
|
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 (currentPage() == m_targetsPage) {
|
||||||
if (symbianTargetSelected || fremantleTargetSelected)
|
if (isSymbianTargetSelected() || isFremantleTargetSelected())
|
||||||
return m_genericOptionsPageId;
|
return m_genericOptionsPageId;
|
||||||
else if (maemoTargetSelected)
|
else if (isMeegoTargetSelected())
|
||||||
return m_maemoOptionsPageId;
|
return m_maemoOptionsPageId;
|
||||||
|
else if (isHarmattanTargetSelected())
|
||||||
|
return m_harmattanOptionsPageId;
|
||||||
else
|
else
|
||||||
return idOfNextGenericPage();
|
return idOfNextGenericPage();
|
||||||
} else if (currentPage() == m_genericOptionsPage) {
|
} else if (currentPage() == m_genericOptionsPage) {
|
||||||
if (symbianTargetSelected)
|
if (isSymbianTargetSelected())
|
||||||
return m_symbianOptionsPageId;
|
return m_symbianOptionsPageId;
|
||||||
|
else if (isFremantleTargetSelected() || isMeegoTargetSelected())
|
||||||
|
return m_maemoOptionsPageId;
|
||||||
else
|
else
|
||||||
return m_maemoOptionsPageId;
|
return m_harmattanOptionsPageId;
|
||||||
} else if (currentPage() == m_symbianOptionsPage) {
|
} else if (currentPage() == m_symbianOptionsPage) {
|
||||||
if (maemoTargetSelected)
|
if (isFremantleTargetSelected() || isMeegoTargetSelected())
|
||||||
return m_maemoOptionsPageId;
|
return m_maemoOptionsPageId;
|
||||||
|
else if (isHarmattanTargetSelected())
|
||||||
|
return m_harmattanOptionsPageId;
|
||||||
|
else
|
||||||
|
return idOfNextGenericPage();
|
||||||
|
} else if (currentPage() == m_maemoOptionsPage) {
|
||||||
|
if (isHarmattanTargetSelected())
|
||||||
|
return m_harmattanOptionsPageId;
|
||||||
else
|
else
|
||||||
return idOfNextGenericPage();
|
return idOfNextGenericPage();
|
||||||
} else {
|
} else {
|
||||||
@@ -125,24 +131,21 @@ int AbstractMobileAppWizardDialog::nextId() const
|
|||||||
void AbstractMobileAppWizardDialog::initializePage(int id)
|
void AbstractMobileAppWizardDialog::initializePage(int id)
|
||||||
{
|
{
|
||||||
if (id == startId()) {
|
if (id == startId()) {
|
||||||
m_targetItem->setNextItems(QList<Utils::WizardProgressItem *>() << m_genericItem << m_maemoItem << itemOfNextGenericPage());
|
m_targetItem->setNextItems(QList<Utils::WizardProgressItem *>()
|
||||||
m_genericItem->setNextItems(QList<Utils::WizardProgressItem *>() << m_symbianItem << m_maemoItem);
|
<< m_genericItem << m_maemoItem << m_harmattanItem << itemOfNextGenericPage());
|
||||||
m_symbianItem->setNextItems(QList<Utils::WizardProgressItem *>() << m_maemoItem << 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) {
|
} 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;
|
QList<Utils::WizardProgressItem *> order;
|
||||||
order << m_genericItem;
|
order << m_genericItem;
|
||||||
if (symbianTargetSelected)
|
if (isSymbianTargetSelected())
|
||||||
order << m_symbianItem;
|
order << m_symbianItem;
|
||||||
if (maemoTargetSelected)
|
if (isFremantleTargetSelected() || isMeegoTargetSelected())
|
||||||
order << m_maemoItem;
|
order << m_maemoItem;
|
||||||
|
if (isHarmattanTargetSelected())
|
||||||
|
order << m_harmattanItem;
|
||||||
order << itemOfNextGenericPage();
|
order << itemOfNextGenericPage();
|
||||||
|
|
||||||
for (int i = 0; i < order.count() - 1; i++)
|
for (int i = 0; i < order.count() - 1; i++)
|
||||||
@@ -162,7 +165,7 @@ void AbstractMobileAppWizardDialog::cleanupPage(int id)
|
|||||||
|
|
||||||
int AbstractMobileAppWizardDialog::idOfNextGenericPage() const
|
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
|
Utils::WizardProgressItem *AbstractMobileAppWizardDialog::itemOfNextGenericPage() const
|
||||||
@@ -170,6 +173,28 @@ Utils::WizardProgressItem *AbstractMobileAppWizardDialog::itemOfNextGenericPage(
|
|||||||
return wizardProgress()->item(idOfNextGenericPage());
|
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,
|
AbstractMobileAppWizard::AbstractMobileAppWizard(const Core::BaseFileWizardParameters ¶ms,
|
||||||
QObject *parent) : Core::BaseFileWizard(params, parent)
|
QObject *parent) : Core::BaseFileWizard(params, parent)
|
||||||
{
|
{
|
||||||
@@ -185,7 +210,8 @@ QWizard *AbstractMobileAppWizard::createWizardDialog(QWidget *parent,
|
|||||||
wdlg->m_genericOptionsPage->setOrientation(app()->orientation());
|
wdlg->m_genericOptionsPage->setOrientation(app()->orientation());
|
||||||
wdlg->m_symbianOptionsPage->setSvgIcon(app()->symbianSvgIcon());
|
wdlg->m_symbianOptionsPage->setSvgIcon(app()->symbianSvgIcon());
|
||||||
wdlg->m_symbianOptionsPage->setNetworkEnabled(app()->networkEnabled());
|
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)),
|
connect(wdlg, SIGNAL(projectParametersChanged(QString, QString)),
|
||||||
SLOT(useProjectPath(QString, QString)));
|
SLOT(useProjectPath(QString, QString)));
|
||||||
foreach (QWizardPage *p, extensionPages)
|
foreach (QWizardPage *p, extensionPages)
|
||||||
@@ -203,7 +229,8 @@ Core::GeneratedFiles AbstractMobileAppWizard::generateFiles(const QWizard *wizar
|
|||||||
app()->setSymbianTargetUid(wdlg->m_symbianOptionsPage->symbianUid());
|
app()->setSymbianTargetUid(wdlg->m_symbianOptionsPage->symbianUid());
|
||||||
app()->setSymbianSvgIcon(wdlg->m_symbianOptionsPage->svgIcon());
|
app()->setSymbianSvgIcon(wdlg->m_symbianOptionsPage->svgIcon());
|
||||||
app()->setNetworkEnabled(wdlg->m_symbianOptionsPage->networkEnabled());
|
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);
|
return app()->generateFiles(errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,20 +71,27 @@ private:
|
|||||||
|
|
||||||
int idOfNextGenericPage() const;
|
int idOfNextGenericPage() const;
|
||||||
Utils::WizardProgressItem *itemOfNextGenericPage() const;
|
Utils::WizardProgressItem *itemOfNextGenericPage() const;
|
||||||
|
bool isSymbianTargetSelected() const;
|
||||||
|
bool isFremantleTargetSelected() const;
|
||||||
|
bool isHarmattanTargetSelected() const;
|
||||||
|
bool isMeegoTargetSelected() const;
|
||||||
|
|
||||||
Internal::MobileAppWizardGenericOptionsPage *m_genericOptionsPage;
|
Internal::MobileAppWizardGenericOptionsPage *m_genericOptionsPage;
|
||||||
Internal::MobileAppWizardSymbianOptionsPage *m_symbianOptionsPage;
|
Internal::MobileAppWizardSymbianOptionsPage *m_symbianOptionsPage;
|
||||||
Internal::MobileAppWizardMaemoOptionsPage *m_maemoOptionsPage;
|
Internal::MobileAppWizardMaemoOptionsPage *m_maemoOptionsPage;
|
||||||
|
Internal::MobileAppWizardMaemoOptionsPage *m_harmattanOptionsPage;
|
||||||
TargetSetupPage *m_targetsPage;
|
TargetSetupPage *m_targetsPage;
|
||||||
|
|
||||||
int m_genericOptionsPageId;
|
int m_genericOptionsPageId;
|
||||||
int m_symbianOptionsPageId;
|
int m_symbianOptionsPageId;
|
||||||
int m_maemoOptionsPageId;
|
int m_maemoOptionsPageId;
|
||||||
|
int m_harmattanOptionsPageId;
|
||||||
int m_targetsPageId;
|
int m_targetsPageId;
|
||||||
Utils::WizardProgressItem *m_targetItem;
|
Utils::WizardProgressItem *m_targetItem;
|
||||||
Utils::WizardProgressItem *m_genericItem;
|
Utils::WizardProgressItem *m_genericItem;
|
||||||
Utils::WizardProgressItem *m_symbianItem;
|
Utils::WizardProgressItem *m_symbianItem;
|
||||||
Utils::WizardProgressItem *m_maemoItem;
|
Utils::WizardProgressItem *m_maemoItem;
|
||||||
|
Utils::WizardProgressItem *m_harmattanItem;
|
||||||
|
|
||||||
friend class AbstractMobileAppWizard;
|
friend class AbstractMobileAppWizard;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="appIconLabel">
|
<widget class="QLabel" name="appIconLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Application icon (64x64):</string>
|
<string>Application icon (%%w%%x%%h%%):</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ class MobileAppWizardSymbianOptionsPagePrivate
|
|||||||
class MobileAppWizardMaemoOptionsPagePrivate
|
class MobileAppWizardMaemoOptionsPagePrivate
|
||||||
{
|
{
|
||||||
Ui::MobileAppWizardMaemoOptionsPage ui;
|
Ui::MobileAppWizardMaemoOptionsPage ui;
|
||||||
|
QSize iconSize;
|
||||||
QString pngIcon;
|
QString pngIcon;
|
||||||
friend class MobileAppWizardMaemoOptionsPage;
|
friend class MobileAppWizardMaemoOptionsPage;
|
||||||
};
|
};
|
||||||
@@ -166,11 +167,18 @@ void MobileAppWizardSymbianOptionsPage::openSvgIcon()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MobileAppWizardMaemoOptionsPage::MobileAppWizardMaemoOptionsPage(QWidget *parent)
|
MobileAppWizardMaemoOptionsPage::MobileAppWizardMaemoOptionsPage(int appIconSize,
|
||||||
|
QWidget *parent)
|
||||||
: QWizardPage(parent)
|
: QWizardPage(parent)
|
||||||
, m_d(new MobileAppWizardMaemoOptionsPagePrivate)
|
, m_d(new MobileAppWizardMaemoOptionsPagePrivate)
|
||||||
{
|
{
|
||||||
m_d->ui.setupUi(this);
|
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()));
|
connect(m_d->ui.pngIconButton, SIGNAL(clicked()), this, SLOT(openPngIcon()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,18 +202,18 @@ void MobileAppWizardMaemoOptionsPage::setPngIcon(const QString &icon)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QSize iconSize(64, 64);
|
|
||||||
QString actualIconPath;
|
QString actualIconPath;
|
||||||
if (iconPixmap.size() == iconSize) {
|
if (iconPixmap.size() == m_d->iconSize) {
|
||||||
actualIconPath = icon;
|
actualIconPath = icon;
|
||||||
} else {
|
} else {
|
||||||
const QMessageBox::StandardButton button = QMessageBox::warning(this,
|
const QMessageBox::StandardButton button = QMessageBox::warning(this,
|
||||||
tr("Wrong Icon Size"), tr("The icon needs to be 64x64 pixels big, "
|
tr("Wrong Icon Size"), tr("The icon needs to be %1x%2 pixels big, "
|
||||||
"but is not. Do you want Creator to scale it?"),
|
"but is not. Do you want Creator to scale it?")
|
||||||
|
.arg(m_d->iconSize.width()).arg(m_d->iconSize.height()),
|
||||||
QMessageBox::Ok | QMessageBox::Cancel);
|
QMessageBox::Ok | QMessageBox::Cancel);
|
||||||
if (button != QMessageBox::Ok)
|
if (button != QMessageBox::Ok)
|
||||||
return;
|
return;
|
||||||
iconPixmap = iconPixmap.scaled(iconSize);
|
iconPixmap = iconPixmap.scaled(m_d->iconSize);
|
||||||
Utils::TempFileSaver saver;
|
Utils::TempFileSaver saver;
|
||||||
saver.setAutoRemove(false);
|
saver.setAutoRemove(false);
|
||||||
if (!saver.hasError())
|
if (!saver.hasError())
|
||||||
|
|||||||
@@ -85,7 +85,8 @@ class MobileAppWizardMaemoOptionsPage : public QWizardPage
|
|||||||
Q_DISABLE_COPY(MobileAppWizardMaemoOptionsPage)
|
Q_DISABLE_COPY(MobileAppWizardMaemoOptionsPage)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit MobileAppWizardMaemoOptionsPage(QWidget *parent = 0);
|
explicit MobileAppWizardMaemoOptionsPage(int appIconSize,
|
||||||
|
QWidget *parent = 0);
|
||||||
virtual ~MobileAppWizardMaemoOptionsPage();
|
virtual ~MobileAppWizardMaemoOptionsPage();
|
||||||
|
|
||||||
QString pngIcon() const;
|
QString pngIcon() const;
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ bool QtQuickApp::generateFiles(QString *errorMessage) const
|
|||||||
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::AppViewerCppFile, errorMessage), path(AppViewerCpp))
|
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::AppViewerCppFile, errorMessage), path(AppViewerCpp))
|
||||||
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::AppViewerHFile, errorMessage), path(AppViewerH))
|
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::AppViewerHFile, errorMessage), path(AppViewerH))
|
||||||
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::SymbianSvgIconFile, errorMessage), path(SymbianSvgIcon))
|
&& 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));
|
&& 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::AppViewerCppFile, errorMessage), path(AppViewerCpp))
|
||||||
&& writeFile(generateFile(Html5AppGeneratedFileInfo::AppViewerHFile, errorMessage), path(AppViewerH))
|
&& writeFile(generateFile(Html5AppGeneratedFileInfo::AppViewerHFile, errorMessage), path(AppViewerH))
|
||||||
&& writeFile(generateFile(Html5AppGeneratedFileInfo::SymbianSvgIconFile, errorMessage), path(SymbianSvgIcon))
|
&& 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));
|
&& writeFile(generateFile(Html5AppGeneratedFileInfo::DesktopFile, errorMessage), path(Desktop));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user