Commit a77c94a6 authored by Pawel Polanski's avatar Pawel Polanski
Browse files

Adding qt plugin support to Symbian's library wizard.

Task-number: QTCREATORBUG-3436
Reviewed-by: Tobias Hunger
parent 7e054be6
......@@ -43,6 +43,7 @@
#include <utils/projectintropage.h>
#include <QtCore/QDebug>
#include <QtCore/QDir>
#include <QtGui/QComboBox>
#include <QtGui/QLabel>
......@@ -244,7 +245,9 @@ int LibraryWizardDialog::nextId() const
// If there was no Symbian target defined we omit "Symbian specific" step
// We also omit this step if the library type is not dll
if (symbianTargetEnabled && type() == QtProjectParameters::SharedLibrary)
if (symbianTargetEnabled
&& (type() == QtProjectParameters::SharedLibrary
|| type() == QtProjectParameters::Qt4Plugin))
next = m_mobilePageId;
if (next == m_modulesPageId)
......@@ -353,6 +356,9 @@ void LibraryWizardDialog::setupFilesPage()
void LibraryWizardDialog::setupMobilePage()
{
m_mobilePage->setSymbianUid(AbstractMobileApp::symbianUidForPath(path()+projectName()));
if (type() == QtProjectParameters::Qt4Plugin)
m_mobilePage->setQtPluginDirectory(projectName());
m_mobilePage->setLibraryType(type());
}
......@@ -381,6 +387,7 @@ MobileLibraryParameters LibraryWizardDialog::mobileLibraryParameters() const
if (mlp.type & MobileLibraryParameters::Symbian) {
mlp.symbianUid = m_mobilePage->symbianUid();
mlp.qtPluginDirectory = m_mobilePage->qtPluginDirectory();
mlp.symbianCapabilities |= m_mobilePage->networkEnabled()?MobileLibraryParameters::NetworkServices:0;
}
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>315</width>
<height>116</height>
</rect>
</property>
<property name="windowTitle">
......
......@@ -35,6 +35,7 @@
#include "qtprojectparameters.h"
#include <QtCore/QTextStream>
#include <QtCore/QDir>
namespace Qt4ProjectManager {
namespace Internal {
......@@ -94,19 +95,31 @@ void MobileLibraryParameters::writeProFile(QTextStream &str) const
void MobileLibraryParameters::writeSymbianProFile(QTextStream &str) const
{
if (libraryType != QtProjectParameters::SharedLibrary)
return; //nothing to do when the library is not a shared library
str << "\n"
"symbian {\n"
" MMP_RULES += EXPORTUNFROZEN\n"
" TARGET.UID3 = " + symbianUid + "\n"
" TARGET.CAPABILITY = " + generateCapabilitySet(symbianCapabilities).toAscii() + "\n"
" TARGET.EPOCALLOWDLLDATA = 1\n"
" addFiles.sources = " + fileName + ".dll\n"
" addFiles.path = !:/sys/bin\n"
" DEPLOYMENT += addFiles\n"
"}\n";
if (libraryType == QtProjectParameters::SharedLibrary) {
str << "\n"
"symbian {\n"
" MMP_RULES += EXPORTUNFROZEN\n"
" TARGET.UID3 = " + symbianUid + "\n"
" TARGET.CAPABILITY = " + generateCapabilitySet(symbianCapabilities).toAscii() + "\n"
" TARGET.EPOCALLOWDLLDATA = 1\n"
" addFiles.sources = " + fileName + ".dll\n"
" addFiles.path = !:/sys/bin\n"
" DEPLOYMENT += addFiles\n"
"}\n";
} else if (libraryType == QtProjectParameters::Qt4Plugin) {
str << "\n"
"symbian {\n"
"# Load predefined include paths (e.g. QT_PLUGINS_BASE_DIR) to be used in the pro-files\n"
" load(data_caging_paths)\n"
" MMP_RULES += EXPORTUNFROZEN\n"
" TARGET.UID3 = " + symbianUid + "\n"
" TARGET.CAPABILITY = " + generateCapabilitySet(symbianCapabilities).toAscii() + "\n"
" TARGET.EPOCALLOWDLLDATA = 1\n"
" pluginDeploy.sources = " + fileName + ".dll\n"
" pluginDeploy.path = $$QT_PLUGINS_BASE_DIR/" + QDir::fromNativeSeparators(qtPluginDirectory) + "\n"
" DEPLOYMENT += pluginDeploy\n"
"}\n";
}
}
void MobileLibraryParameters::writeMaemoProFile(QTextStream &str) const
......
......@@ -84,6 +84,7 @@ public:
QString fileName;
QString symbianUid;
QString qtPluginDirectory;
uint symbianCapabilities;
};
......
......@@ -84,9 +84,27 @@ bool MobileLibraryWizardOptionPage::networkEnabled() const
return m_d->ui.symbianEnableNetworkCheckBox->isChecked();
}
QString MobileLibraryWizardOptionPage::qtPluginDirectory() const
{
return m_d->ui.qtPluginLocationLineEdit->text();
}
void MobileLibraryWizardOptionPage::setQtPluginDirectory(const QString &directory)
{
m_d->ui.qtPluginLocationLineEdit->setText(directory);
}
void MobileLibraryWizardOptionPage::setLibraryType(int type)
{
m_d->libraryType = static_cast<QtProjectParameters::Type>(type);
if (type != QtProjectParameters::Qt4Plugin) {
m_d->ui.qtPluginLocationLineEdit->setVisible(false);
m_d->ui.qtPluginLocationLabel->setVisible(false);
m_d->ui.formLayout_2->removeItem(m_d->ui.horizontalLayout_2);
delete m_d->ui.horizontalLayout_2;
m_d->ui.horizontalLayout_2 = 0;
}
}
} // namespace Internal
......
......@@ -52,6 +52,8 @@ public:
QString symbianUid() const;
void setNetworkEnabled(bool enableIt);
bool networkEnabled() const;
QString qtPluginDirectory() const;
void setQtPluginDirectory(const QString &directory);
void setLibraryType(int type);
private:
......
......@@ -7,13 +7,13 @@
<x>0</x>
<y>0</y>
<width>404</width>
<height>548</height>
<height>130</height>
</rect>
</property>
<property name="windowTitle">
<string>WizardPage</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QFrame" name="frame">
<property name="frameShape">
......@@ -22,16 +22,9 @@
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="1" column="0">
<widget class="QCheckBox" name="symbianEnableNetworkCheckBox">
<property name="text">
<string>Enable network access</string>
</property>
</widget>
</item>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="symbianTargetUid3Label">
<property name="sizePolicy">
......@@ -54,7 +47,7 @@
<widget class="QLineEdit" name="symbianTargetUid3LineEdit"/>
</item>
<item>
<spacer name="horizontalSpacer_2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
......@@ -68,24 +61,49 @@
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="qtPluginLocationLabel">
<property name="text">
<string>Plugin's directory name:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLineEdit" name="qtPluginLocationLineEdit"/>
</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>
<item row="2" column="0">
<widget class="QCheckBox" name="symbianEnableNetworkCheckBox">
<property name="text">
<string>Enable network access</string>
</property>
</widget>
</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/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment