forked from qt-creator/qt-creator
Improved library creation for mobile targets
Reviewed-by: Alessandro Portale
This commit is contained in:
@@ -19,6 +19,8 @@ HEADERS += qt4deployconfiguration.h \
|
|||||||
wizards/mobileapp.h \
|
wizards/mobileapp.h \
|
||||||
wizards/mobileappwizard.h \
|
wizards/mobileappwizard.h \
|
||||||
wizards/mobileappwizardpages.h \
|
wizards/mobileappwizardpages.h \
|
||||||
|
wizards/mobilelibrarywizardoptionpage.h \
|
||||||
|
wizards/mobilelibraryparameters.h \
|
||||||
wizards/consoleappwizard.h \
|
wizards/consoleappwizard.h \
|
||||||
wizards/consoleappwizarddialog.h \
|
wizards/consoleappwizarddialog.h \
|
||||||
wizards/libraryparameters.h \
|
wizards/libraryparameters.h \
|
||||||
@@ -75,6 +77,8 @@ SOURCES += qt4projectmanagerplugin.cpp \
|
|||||||
wizards/mobileapp.cpp \
|
wizards/mobileapp.cpp \
|
||||||
wizards/mobileappwizard.cpp \
|
wizards/mobileappwizard.cpp \
|
||||||
wizards/mobileappwizardpages.cpp \
|
wizards/mobileappwizardpages.cpp \
|
||||||
|
wizards/mobilelibrarywizardoptionpage.cpp \
|
||||||
|
wizards/mobilelibraryparameters.cpp \
|
||||||
wizards/consoleappwizard.cpp \
|
wizards/consoleappwizard.cpp \
|
||||||
wizards/consoleappwizarddialog.cpp \
|
wizards/consoleappwizarddialog.cpp \
|
||||||
wizards/libraryparameters.cpp \
|
wizards/libraryparameters.cpp \
|
||||||
@@ -124,6 +128,7 @@ FORMS += makestep.ui \
|
|||||||
wizards/targetsetuppage.ui \
|
wizards/targetsetuppage.ui \
|
||||||
wizards/qmlstandaloneappwizardsourcespage.ui \
|
wizards/qmlstandaloneappwizardsourcespage.ui \
|
||||||
wizards/mobileappwizardoptionspage.ui \
|
wizards/mobileappwizardoptionspage.ui \
|
||||||
|
wizards/mobilelibrarywizardoptionpage.ui \
|
||||||
librarydetailswidget.ui
|
librarydetailswidget.ui
|
||||||
RESOURCES += qt4projectmanager.qrc \
|
RESOURCES += qt4projectmanager.qrc \
|
||||||
wizards/wizards.qrc
|
wizards/wizards.qrc
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include "librarywizarddialog.h"
|
#include "librarywizarddialog.h"
|
||||||
#include "qt4projectmanager.h"
|
#include "qt4projectmanager.h"
|
||||||
#include "qt4projectmanagerconstants.h"
|
#include "qt4projectmanagerconstants.h"
|
||||||
|
#include "mobilelibraryparameters.h"
|
||||||
|
|
||||||
#include <utils/codegeneration.h>
|
#include <utils/codegeneration.h>
|
||||||
#include <cpptools/cppmodelmanagerinterface.h>
|
#include <cpptools/cppmodelmanagerinterface.h>
|
||||||
@@ -82,6 +83,7 @@ Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w,
|
|||||||
const QtProjectParameters projectParams = dialog->parameters();
|
const QtProjectParameters projectParams = dialog->parameters();
|
||||||
const QString projectPath = projectParams.projectPath();
|
const QString projectPath = projectParams.projectPath();
|
||||||
const LibraryParameters params = dialog->libraryParameters();
|
const LibraryParameters params = dialog->libraryParameters();
|
||||||
|
const MobileLibraryParameters mobileParams = dialog->mobileLibraryParameters();
|
||||||
|
|
||||||
const QString sharedLibExportMacro = QtProjectParameters::exportMacro(projectParams.fileName);
|
const QString sharedLibExportMacro = QtProjectParameters::exportMacro(projectParams.fileName);
|
||||||
|
|
||||||
@@ -131,6 +133,8 @@ Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w,
|
|||||||
<< "\n\nHEADERS += " << headerFileName;
|
<< "\n\nHEADERS += " << headerFileName;
|
||||||
if (!globalHeaderFileName.isEmpty())
|
if (!globalHeaderFileName.isEmpty())
|
||||||
proStr << "\\\n " << globalHeaderFileName << '\n';
|
proStr << "\\\n " << globalHeaderFileName << '\n';
|
||||||
|
if (mobileParams.type)
|
||||||
|
mobileParams.writeProFile(proStr);
|
||||||
}
|
}
|
||||||
profile.setContents(profileContents);
|
profile.setContents(profileContents);
|
||||||
rc.push_back(profile);
|
rc.push_back(profile);
|
||||||
|
|||||||
@@ -31,6 +31,10 @@
|
|||||||
#include "filespage.h"
|
#include "filespage.h"
|
||||||
#include "libraryparameters.h"
|
#include "libraryparameters.h"
|
||||||
#include "modulespage.h"
|
#include "modulespage.h"
|
||||||
|
#include "mobilelibrarywizardoptionpage.h"
|
||||||
|
#include "mobilelibraryparameters.h"
|
||||||
|
#include "abstractmobileapp.h"
|
||||||
|
#include "qt4projectmanagerconstants.h"
|
||||||
|
|
||||||
#include <utils/projectintropage.h>
|
#include <utils/projectintropage.h>
|
||||||
|
|
||||||
@@ -134,8 +138,10 @@ LibraryWizardDialog::LibraryWizardDialog(const QString &templateName,
|
|||||||
QWidget *parent) :
|
QWidget *parent) :
|
||||||
BaseQt4ProjectWizardDialog(showModulesPage, new LibraryIntroPage, -1, parent),
|
BaseQt4ProjectWizardDialog(showModulesPage, new LibraryIntroPage, -1, parent),
|
||||||
m_filesPage(new FilesPage),
|
m_filesPage(new FilesPage),
|
||||||
|
m_mobilePage(new MobileLibraryWizardOptionPage),
|
||||||
m_pluginBaseClassesInitialized(false),
|
m_pluginBaseClassesInitialized(false),
|
||||||
m_filesPageId(-1), m_modulesPageId(-1), m_targetPageId(-1)
|
m_filesPageId(-1), m_modulesPageId(-1), m_targetPageId(-1),
|
||||||
|
m_mobilePageId(-1)
|
||||||
{
|
{
|
||||||
setWindowIcon(icon);
|
setWindowIcon(icon);
|
||||||
setWindowTitle(templateName);
|
setWindowTitle(templateName);
|
||||||
@@ -155,6 +161,9 @@ LibraryWizardDialog::LibraryWizardDialog(const QString &templateName,
|
|||||||
m_filesPageId = addPage(m_filesPage);
|
m_filesPageId = addPage(m_filesPage);
|
||||||
wizardProgress()->item(m_filesPageId)->setTitle(tr("Details"));
|
wizardProgress()->item(m_filesPageId)->setTitle(tr("Details"));
|
||||||
|
|
||||||
|
m_mobilePageId = addPage(m_mobilePage);
|
||||||
|
wizardProgress()->item(m_mobilePageId)->setTitle(tr("Symbian specific"));
|
||||||
|
|
||||||
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
|
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
|
||||||
|
|
||||||
foreach (QWizardPage *p, extensionPages)
|
foreach (QWizardPage *p, extensionPages)
|
||||||
@@ -171,6 +180,11 @@ void LibraryWizardDialog::setLowerCaseFiles(bool l)
|
|||||||
m_filesPage->setLowerCaseFiles(l);
|
m_filesPage->setLowerCaseFiles(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LibraryWizardDialog::setSymbianUid(const QString &uid)
|
||||||
|
{
|
||||||
|
m_mobilePage->setSymbianUid(uid);
|
||||||
|
}
|
||||||
|
|
||||||
QtProjectParameters::Type LibraryWizardDialog::type() const
|
QtProjectParameters::Type LibraryWizardDialog::type() const
|
||||||
{
|
{
|
||||||
return static_cast<const LibraryIntroPage*>(introPage())->type();
|
return static_cast<const LibraryIntroPage*>(introPage())->type();
|
||||||
@@ -178,6 +192,18 @@ QtProjectParameters::Type LibraryWizardDialog::type() const
|
|||||||
|
|
||||||
int LibraryWizardDialog::nextId() const
|
int LibraryWizardDialog::nextId() const
|
||||||
{
|
{
|
||||||
|
//if there was no Symbian target defined we omit "Symbian specific" step
|
||||||
|
//we omit this step if the library type is not dll
|
||||||
|
if (currentId() == m_filesPageId) {
|
||||||
|
bool symbianTargetEnabled = isTargetSelected(QLatin1String(Constants::S60_DEVICE_TARGET_ID))
|
||||||
|
|| isTargetSelected(QLatin1String(Constants::S60_EMULATOR_TARGET_ID));
|
||||||
|
if (!symbianTargetEnabled || type() != QtProjectParameters::SharedLibrary) {
|
||||||
|
QList<int> ids = pageIds();
|
||||||
|
int mobileIndex = ids.lastIndexOf(m_mobilePageId);
|
||||||
|
if (mobileIndex>=0)
|
||||||
|
return ids[mobileIndex+1];
|
||||||
|
}
|
||||||
|
}
|
||||||
// When leaving the intro or target page, the modules page is skipped
|
// When leaving the intro or target page, the modules page is skipped
|
||||||
// in the case of a plugin since it knows its dependencies by itself.
|
// in the case of a plugin since it knows its dependencies by itself.
|
||||||
const int m_beforeModulesPageId = m_targetPageId != -1 ? m_targetPageId : 0;
|
const int m_beforeModulesPageId = m_targetPageId != -1 ? m_targetPageId : 0;
|
||||||
@@ -215,9 +241,15 @@ void LibraryWizardDialog::slotCurrentIdChanged(int id)
|
|||||||
{
|
{
|
||||||
if (debugLibWizard)
|
if (debugLibWizard)
|
||||||
qDebug() << Q_FUNC_INFO << id;
|
qDebug() << Q_FUNC_INFO << id;
|
||||||
// Switching to files page: Set up base class accordingly (plugin)
|
if (id == m_filesPageId)
|
||||||
if (id != m_filesPageId)
|
setupFilesPage();// Switching to files page: Set up base class accordingly (plugin)
|
||||||
return;
|
else if (id == m_mobilePageId
|
||||||
|
|| m_mobilePage->symbianUid().isEmpty() && currentPage()->isFinalPage())
|
||||||
|
setupMobilePage();
|
||||||
|
}
|
||||||
|
|
||||||
|
void LibraryWizardDialog::setupFilesPage()
|
||||||
|
{
|
||||||
switch (type()) {
|
switch (type()) {
|
||||||
case QtProjectParameters::Qt4Plugin:
|
case QtProjectParameters::Qt4Plugin:
|
||||||
if (!m_pluginBaseClassesInitialized) {
|
if (!m_pluginBaseClassesInitialized) {
|
||||||
@@ -246,6 +278,12 @@ void LibraryWizardDialog::slotCurrentIdChanged(int id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LibraryWizardDialog::setupMobilePage()
|
||||||
|
{
|
||||||
|
m_mobilePage->setSymbianUid(AbstractMobileApp::symbianUidForPath(path()+projectName()));
|
||||||
|
m_mobilePage->setLibraryType(type());
|
||||||
|
}
|
||||||
|
|
||||||
LibraryParameters LibraryWizardDialog::libraryParameters() const
|
LibraryParameters LibraryWizardDialog::libraryParameters() const
|
||||||
{
|
{
|
||||||
LibraryParameters rc;
|
LibraryParameters rc;
|
||||||
@@ -260,5 +298,25 @@ LibraryParameters LibraryWizardDialog::libraryParameters() const
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MobileLibraryParameters LibraryWizardDialog::mobileLibraryParameters() const
|
||||||
|
{
|
||||||
|
MobileLibraryParameters mlp;
|
||||||
|
mlp.libraryType = type();
|
||||||
|
mlp.fileName = projectName();
|
||||||
|
|
||||||
|
//Symbian and Maemo stuff should always be added to pro file. Even if no mobile target is specified
|
||||||
|
mlp.type |= MobileLibraryParameters::Symbian|MobileLibraryParameters::Maemo;
|
||||||
|
|
||||||
|
if (mlp.type & MobileLibraryParameters::Symbian) {
|
||||||
|
mlp.symbianUid = m_mobilePage->symbianUid();
|
||||||
|
mlp.symbianCapabilities |= m_mobilePage->networkEnabled()?MobileLibraryParameters::NetworkServices:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mlp.type & MobileLibraryParameters::Maemo) {
|
||||||
|
//TODO fill this for Maemo
|
||||||
|
}
|
||||||
|
return mlp;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -38,7 +38,9 @@ namespace Internal {
|
|||||||
|
|
||||||
struct QtProjectParameters;
|
struct QtProjectParameters;
|
||||||
class FilesPage;
|
class FilesPage;
|
||||||
|
class MobileLibraryWizardOptionPage;
|
||||||
struct LibraryParameters;
|
struct LibraryParameters;
|
||||||
|
struct MobileLibraryParameters;
|
||||||
|
|
||||||
// Library wizard dialog.
|
// Library wizard dialog.
|
||||||
class LibraryWizardDialog : public BaseQt4ProjectWizardDialog
|
class LibraryWizardDialog : public BaseQt4ProjectWizardDialog
|
||||||
@@ -54,9 +56,11 @@ public:
|
|||||||
|
|
||||||
void setSuffixes(const QString &header, const QString &source, const QString &form= QString());
|
void setSuffixes(const QString &header, const QString &source, const QString &form= QString());
|
||||||
void setLowerCaseFiles(bool);
|
void setLowerCaseFiles(bool);
|
||||||
|
void setSymbianUid(const QString &uid);
|
||||||
|
|
||||||
QtProjectParameters parameters() const;
|
QtProjectParameters parameters() const;
|
||||||
LibraryParameters libraryParameters() const;
|
LibraryParameters libraryParameters() const;
|
||||||
|
MobileLibraryParameters mobileLibraryParameters() const;
|
||||||
|
|
||||||
virtual int nextId() const;
|
virtual int nextId() const;
|
||||||
|
|
||||||
@@ -65,12 +69,16 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QtProjectParameters::Type type() const;
|
QtProjectParameters::Type type() const;
|
||||||
|
void setupFilesPage();
|
||||||
|
void setupMobilePage();
|
||||||
|
|
||||||
FilesPage *m_filesPage;
|
FilesPage *m_filesPage;
|
||||||
|
MobileLibraryWizardOptionPage *m_mobilePage;
|
||||||
bool m_pluginBaseClassesInitialized;
|
bool m_pluginBaseClassesInitialized;
|
||||||
int m_filesPageId;
|
int m_filesPageId;
|
||||||
int m_modulesPageId;
|
int m_modulesPageId;
|
||||||
int m_targetPageId;
|
int m_targetPageId;
|
||||||
|
int m_mobilePageId;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -0,0 +1,119 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** Commercial Usage
|
||||||
|
**
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
**
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** If you are unsure which license is appropriate for your use, please
|
||||||
|
** contact the sales department at http://qt.nokia.com/contact.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
#include "mobilelibraryparameters.h"
|
||||||
|
#include "qtprojectparameters.h"
|
||||||
|
|
||||||
|
#include <QtCore/QTextStream>
|
||||||
|
|
||||||
|
namespace Qt4ProjectManager {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
struct SymbianCapability {
|
||||||
|
const char *name;
|
||||||
|
const int value;
|
||||||
|
};
|
||||||
|
|
||||||
|
static const SymbianCapability symbianCapability[] =
|
||||||
|
{
|
||||||
|
{ "LocalServices", MobileLibraryParameters::LocalServices },
|
||||||
|
{ "Location", MobileLibraryParameters::Location },
|
||||||
|
{ "NetworkServices", MobileLibraryParameters::NetworkServices },
|
||||||
|
{ "ReadUserData", MobileLibraryParameters::ReadUserData },
|
||||||
|
{ "UserEnvironment", MobileLibraryParameters::UserEnvironment },
|
||||||
|
{ "WriteUserData", MobileLibraryParameters::WriteUserData },
|
||||||
|
{ "PowerMgmt", MobileLibraryParameters::PowerMgmt },
|
||||||
|
{ "ProtServ", MobileLibraryParameters::ProtServ },
|
||||||
|
{ "ReadDeviceData", MobileLibraryParameters::ReadDeviceData },
|
||||||
|
{ "SurroundingsDD", MobileLibraryParameters::SurroundingsDD },
|
||||||
|
{ "SwEvent", MobileLibraryParameters::SwEvent },
|
||||||
|
{ "TrustedUI", MobileLibraryParameters::TrustedUI },
|
||||||
|
{ "WriteDeviceData", MobileLibraryParameters::WriteDeviceData },
|
||||||
|
{ "CommDD", MobileLibraryParameters::CommDD },
|
||||||
|
{ "DiskAdmin", MobileLibraryParameters::DiskAdmin },
|
||||||
|
{ "NetworkControl", MobileLibraryParameters::NetworkControl },
|
||||||
|
{ "MultimediaDD", MobileLibraryParameters::MultimediaDD },
|
||||||
|
{ "AllFiles", MobileLibraryParameters::AllFiles },
|
||||||
|
{ "DRM", MobileLibraryParameters::DRM },
|
||||||
|
{ "TCB", MobileLibraryParameters::TCB },
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
QString generateCapabilitySet(uint capabilities)
|
||||||
|
{
|
||||||
|
const int symbianCapabilityCount = sizeof(symbianCapability)/sizeof(SymbianCapability);
|
||||||
|
QString capabilitySet;
|
||||||
|
for(int i = 0; i < symbianCapabilityCount; ++i)
|
||||||
|
if (capabilities&symbianCapability[i].value)
|
||||||
|
capabilitySet += QLatin1String(symbianCapability[i].name) + " ";
|
||||||
|
return capabilitySet;
|
||||||
|
}
|
||||||
|
|
||||||
|
MobileLibraryParameters::MobileLibraryParameters() :
|
||||||
|
type(0), libraryType(TypeNone), symbianCapabilities(CapabilityNone)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void MobileLibraryParameters::writeProFile(QTextStream &str) const
|
||||||
|
{
|
||||||
|
if (type&Symbian)
|
||||||
|
writeSymbianProFile(str);
|
||||||
|
if (type&Maemo)
|
||||||
|
writeMaemoProFile(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MobileLibraryParameters::writeSymbianProFile(QTextStream &str) const
|
||||||
|
{
|
||||||
|
if (libraryType != QtProjectParameters::SharedLibrary)
|
||||||
|
return; //nothing to do when the library is not shared library
|
||||||
|
|
||||||
|
str << "\n"
|
||||||
|
"symbian {\n"
|
||||||
|
" #Symbian specific definitions\n"
|
||||||
|
" MMP_RULES += EXPORTUNFROZEN\n"
|
||||||
|
" TARGET.UID3 = " + symbianUid + "\n"
|
||||||
|
" TARGET.CAPABILITY = " + generateCapabilitySet(symbianCapabilities).toAscii() + "\n"
|
||||||
|
" TARGET.EPOCALLOWDLLDATA = 1\n"
|
||||||
|
" BLD_INF_RULES.prj_exports += \"" + fileName + ".h\"\n"
|
||||||
|
" BLD_INF_RULES.prj_exports += \"" + fileName + "_global.h\"\n"
|
||||||
|
" addFiles.sources = " + fileName + ".dll\n"
|
||||||
|
" addFiles.path = !:/sys/bin\n"
|
||||||
|
" DEPLOYMENT += addFiles\n"
|
||||||
|
"}\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
void MobileLibraryParameters::writeMaemoProFile(QTextStream &str) const
|
||||||
|
{
|
||||||
|
str << "\n"
|
||||||
|
"maemo {\n" //TODO fill it for Maemo
|
||||||
|
"}\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
} // namespace Qt4ProjectManager
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** Commercial Usage
|
||||||
|
**
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
**
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** If you are unsure which license is appropriate for your use, please
|
||||||
|
** contact the sales department at http://qt.nokia.com/contact.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
#ifndef MOBILELIBRARYPARAMETERS_H
|
||||||
|
#define MOBILELIBRARYPARAMETERS_H
|
||||||
|
|
||||||
|
#include <QtCore/QString>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QTextStream;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
namespace Qt4ProjectManager {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
// Additional parameters required for creating mobile
|
||||||
|
// libraries
|
||||||
|
struct MobileLibraryParameters {
|
||||||
|
enum Type { TypeNone = 0, Symbian = 0x1, Maemo = 0x2 };
|
||||||
|
enum Capability {
|
||||||
|
CapabilityNone = 0,
|
||||||
|
LocalServices = 1 << 0,
|
||||||
|
Location = 1 << 1,
|
||||||
|
NetworkServices = 1 << 2,
|
||||||
|
ReadUserData = 1 << 3,
|
||||||
|
UserEnvironment = 1 << 4,
|
||||||
|
WriteUserData = 1 << 5,
|
||||||
|
PowerMgmt = 1 << 6,
|
||||||
|
ProtServ = 1 << 7,
|
||||||
|
ReadDeviceData = 1 << 8,
|
||||||
|
SurroundingsDD = 1 << 9,
|
||||||
|
SwEvent = 1 << 10,
|
||||||
|
TrustedUI = 1 << 11,
|
||||||
|
WriteDeviceData = 1 << 12,
|
||||||
|
CommDD = 1 << 13,
|
||||||
|
DiskAdmin = 1 << 14,
|
||||||
|
NetworkControl = 1 << 15,
|
||||||
|
MultimediaDD = 1 << 16,
|
||||||
|
AllFiles = 1 << 17,
|
||||||
|
DRM = 1 << 18,
|
||||||
|
TCB = 1 << 19
|
||||||
|
};
|
||||||
|
|
||||||
|
MobileLibraryParameters();
|
||||||
|
void writeProFile(QTextStream &str) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void writeSymbianProFile(QTextStream &str) const;
|
||||||
|
void writeMaemoProFile(QTextStream &str) const;
|
||||||
|
|
||||||
|
public:
|
||||||
|
uint type;
|
||||||
|
uint libraryType;
|
||||||
|
QString fileName;
|
||||||
|
|
||||||
|
QString symbianUid;
|
||||||
|
uint symbianCapabilities;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
} // namespace Qt4ProjectManager
|
||||||
|
#endif // MOBILELIBRARYPARAMETERS_H
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** Commercial Usage
|
||||||
|
**
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
**
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** If you are unsure which license is appropriate for your use, please
|
||||||
|
** contact the sales department at http://qt.nokia.com/contact.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
#include "MobileLibraryWizardOptionPage.h"
|
||||||
|
#include "ui_mobilelibrarywizardoptionpage.h"
|
||||||
|
#include "qtprojectparameters.h"
|
||||||
|
|
||||||
|
#include <coreplugin/coreconstants.h>
|
||||||
|
|
||||||
|
#include <QtGui/QDesktopServices>
|
||||||
|
#include <QtGui/QFileDialog>
|
||||||
|
#include <QtGui/QMessageBox>
|
||||||
|
|
||||||
|
namespace Qt4ProjectManager {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
class MobileLibraryWizardOptionPagePrivate
|
||||||
|
{
|
||||||
|
Ui::MobileLibraryWizardOptionPage ui;
|
||||||
|
friend class MobileLibraryWizardOptionPage;
|
||||||
|
|
||||||
|
QtProjectParameters::Type libraryType;
|
||||||
|
};
|
||||||
|
|
||||||
|
MobileLibraryWizardOptionPage::MobileLibraryWizardOptionPage(QWidget *parent)
|
||||||
|
: QWizardPage(parent)
|
||||||
|
, m_d(new MobileLibraryWizardOptionPagePrivate)
|
||||||
|
{
|
||||||
|
m_d->ui.setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
MobileLibraryWizardOptionPage::~MobileLibraryWizardOptionPage()
|
||||||
|
{
|
||||||
|
delete m_d;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString MobileLibraryWizardOptionPage::symbianUid() const
|
||||||
|
{
|
||||||
|
return m_d->ui.symbianTargetUid3LineEdit->text();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MobileLibraryWizardOptionPage::setSymbianUid(const QString &uid)
|
||||||
|
{
|
||||||
|
m_d->ui.symbianTargetUid3LineEdit->setText(uid);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MobileLibraryWizardOptionPage::setNetworkEnabled(bool enableIt)
|
||||||
|
{
|
||||||
|
m_d->ui.symbianEnableNetworkChackBox->setChecked(enableIt);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MobileLibraryWizardOptionPage::networkEnabled() const
|
||||||
|
{
|
||||||
|
return m_d->ui.symbianEnableNetworkChackBox->isChecked();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MobileLibraryWizardOptionPage::setLibraryType(int type)
|
||||||
|
{
|
||||||
|
m_d->libraryType = static_cast<QtProjectParameters::Type>(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
} // namespace Qt4ProjectManager
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** Commercial Usage
|
||||||
|
**
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
**
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** If you are unsure which license is appropriate for your use, please
|
||||||
|
** contact the sales department at http://qt.nokia.com/contact.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
#ifndef MOBILELIBRARYWIZARDOPTIONPAGE_H
|
||||||
|
#define MOBILELIBRARYWIZARDOPTIONPAGE_H
|
||||||
|
|
||||||
|
#include <QtGui/QWizardPage>
|
||||||
|
|
||||||
|
namespace Qt4ProjectManager {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
class MobileLibraryWizardOptionPage : public QWizardPage
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_DISABLE_COPY(MobileLibraryWizardOptionPage)
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit MobileLibraryWizardOptionPage(QWidget *parent = 0);
|
||||||
|
virtual ~MobileLibraryWizardOptionPage();
|
||||||
|
|
||||||
|
void setSymbianUid(const QString &uid);
|
||||||
|
QString symbianUid() const;
|
||||||
|
void setNetworkEnabled(bool enableIt);
|
||||||
|
bool networkEnabled() const;
|
||||||
|
void setLibraryType(int type);
|
||||||
|
|
||||||
|
private:
|
||||||
|
class MobileLibraryWizardOptionPagePrivate *m_d;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // end of namespace Internal
|
||||||
|
} // end of namespace Qt4ProjectManager
|
||||||
|
|
||||||
|
#endif // MOBILELIBRARYWIZARDOPTIONPAGE_H
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>MobileLibraryWizardOptionPage</class>
|
||||||
|
<widget class="QWizardPage" name="MobileLibraryWizardOptionPage">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>404</width>
|
||||||
|
<height>548</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>WizardPage</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QFormLayout" name="formLayout">
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QCheckBox" name="symbianEnableNetworkChackBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Enable network access</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="symbianTargetUid3Label">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Target UID3:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>symbianTargetUid3LineEdit</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="symbianTargetUid3LineEdit"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
Reference in New Issue
Block a user