Commit 14cb9f91 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Make Meego target work.

- Package installation and running untested yet.
- User currently needs to adapt %files section in spec file manually.
  We expect this task to be automated by the build script in the future
  (see http://bugs.meego.com/show_bug.cgi?id=13148).
parent a9231c30
......@@ -229,6 +229,7 @@ static DebuggerEngineType engineForToolChain(ToolChainType toolChainType)
case ToolChain_GCCE_GNUPOC:
case ToolChain_GCC_MAEMO5:
case ToolChain_GCC_HARMATTAN:
case ToolChain_GCC_MEEGO:
#ifdef WITH_LLDB
// lldb override
if (Core::ICore::instance()->settings()->value("LLDB/enabled").toBool())
......
......@@ -82,6 +82,7 @@ static QList<int> allGdbToolChains()
#endif
<< ProjectExplorer::ToolChain_GCC_MAEMO5
<< ProjectExplorer::ToolChain_GCC_HARMATTAN
<< ProjectExplorer::ToolChain_GCC_MEEGO
#ifdef Q_OS_UNIX
<< ProjectExplorer::ToolChain_GCCE_GNUPOC
<< ProjectExplorer::ToolChain_RVCT_ARMV5_GNUPOC
......@@ -464,6 +465,7 @@ ToolChainSelectorWidget::ToolChainSelectorWidget(QWidget *parent) :
break;
case ProjectExplorer::ToolChain_GCC_MAEMO5:
case ProjectExplorer::ToolChain_GCC_HARMATTAN:
case ProjectExplorer::ToolChain_GCC_MEEGO:
maemoLayout->addWidget(createToolChainCheckBox(tc));
break;
case ProjectExplorer::ToolChain_INVALID:
......
......@@ -85,6 +85,7 @@ AbstractGdbAdapter::DumperHandling RemoteGdbServerAdapter::dumperHandling() cons
case ProjectExplorer::ToolChain_RVCT2_ARMV6:
case ProjectExplorer::ToolChain_GCC_MAEMO5:
case ProjectExplorer::ToolChain_GCC_HARMATTAN:
case ProjectExplorer::ToolChain_GCC_MEEGO:
return DumperLoadedByGdb;
default:
break;
......
......@@ -165,6 +165,8 @@ QString ToolChain::toolChainName(ToolChainType tc)
return QCoreApplication::translate("ToolChain", "GCC for Maemo5");
case ToolChain_GCC_HARMATTAN:
return QCoreApplication::translate("ToolChain", "GCC for Harmattan");
case ToolChain_GCC_MEEGO:
return QCoreApplication::translate("ToolChain", "GCC for Meego");
case ToolChain_OTHER:
return QCoreApplication::translate("ToolChain", "Other");
case ToolChain_INVALID:
......
......@@ -53,7 +53,8 @@ enum ToolChainType
ToolChain_RVCT4_ARMV5 = 12,
ToolChain_RVCT4_ARMV6 = 13,
ToolChain_GCC_HARMATTAN = 14,
ToolChain_LAST_VALID = 14,
ToolChain_GCC_MEEGO = 15,
ToolChain_LAST_VALID = 15,
ToolChain_OTHER = 200,
ToolChain_UNKNOWN = 201,
ToolChain_INVALID = 202
......
......@@ -82,7 +82,8 @@ DebuggingHelperBuildTask::DebuggingHelperBuildTask(QtVersion *version, Tools too
tc->addToEnvironment(m_environment);
if (tc->type() == ProjectExplorer::ToolChain_GCC_MAEMO5
|| tc->type() == ProjectExplorer::ToolChain_GCC_HARMATTAN) {
|| tc->type() == ProjectExplorer::ToolChain_GCC_HARMATTAN
|| tc->type() == ProjectExplorer::ToolChain_GCC_MEEGO) {
m_target = QLatin1String("-unix");
}
......
......@@ -39,6 +39,7 @@
#include "maemoglobal.h"
#include "maemosshrunner.h"
#include "maemousedportsgatherer.h"
#include "qt4maemotarget.h"
#include <coreplugin/ssh/sftpchannel.h>
#include <debugger/debuggerplugin.h>
......@@ -103,8 +104,10 @@ RunControl *MaemoDebugSupport::createDebugRunControl(MaemoRunConfiguration *runC
params.remoteChannel
= devConf->sshParameters().host + QLatin1String(":-1");
params.useServerStartScript = true;
params.remoteArchitecture = QLatin1String("arm");
params.gnuTarget = QLatin1String("arm-none-linux-gnueabi");
const AbstractQt4MaemoTarget::DebugArchitecture &debugArch
= runConfig->maemoTarget()->debugArchitecture();
params.remoteArchitecture = debugArch.architecture;
params.gnuTarget = debugArch.gnuTarget;
}
} else {
params.startMode = AttachToRemote;
......
......@@ -94,6 +94,8 @@ void MaemoDeployStep::ctor()
setDefaultDisplayName(tr("Deploy to Maemo5 device"));
else if (target()->id() == QLatin1String(Constants::HARMATTAN_DEVICE_TARGET_ID))
setDefaultDisplayName(tr("Deploy to Harmattan device"));
else if (target()->id() == QLatin1String(Constants::MEEGO_DEVICE_TARGET_ID))
setDefaultDisplayName(tr("Deploy to Meego device"));
// A MaemoDeployables object is only dependent on the active build
// configuration and therefore can (and should) be shared among all
......@@ -438,7 +440,7 @@ void MaemoDeployStep::handleSftpJobFinished(Core::SftpJobId,
.arg(filePathNative));
const QString remoteFilePath
= uploadDir() + QLatin1Char('/') + QFileInfo(filePathNative).fileName();
runDpkg(remoteFilePath);
runPackageInstaller(remoteFilePath);
}
}
......@@ -457,7 +459,7 @@ void MaemoDeployStep::handleMounted()
if (m_needsInstall) {
const QString remoteFilePath = deployMountPoint() + QLatin1Char('/')
+ QFileInfo(packagingStep()->packageFilePath()).fileName();
runDpkg(remoteFilePath);
runPackageInstaller(remoteFilePath);
} else {
setState(CopyingFile);
copyNextFileToDevice();
......@@ -701,15 +703,17 @@ void MaemoDeployStep::unmountOldDirs()
unmount();
}
void MaemoDeployStep::runDpkg(const QString &packageFilePath)
void MaemoDeployStep::runPackageInstaller(const QString &packageFilePath)
{
ASSERT_STATE(QList<State>() << Mounting << Uploading);
const bool removeAfterInstall = m_state == Uploading;
setState(InstallingToDevice);
writeOutput(tr("Installing package to device..."));
QByteArray cmd = MaemoGlobal::remoteSudo().toUtf8() + " dpkg -i "
+ packageFilePath.toUtf8();
const QByteArray installCommand
= packagingStep()->debBasedMaemoTarget() ? "dpkg -i" : "rpm -Uhv";
QByteArray cmd = MaemoGlobal::remoteSudo().toUtf8() + ' '
+ installCommand + ' ' + packageFilePath.toUtf8();
if (removeAfterInstall)
cmd += " && (rm " + packageFilePath.toUtf8() + " || :)";
m_deviceInstaller = m_connection->createRemoteProcess(cmd);
......
......@@ -151,7 +151,7 @@ private:
void unmountOldDirs();
void setupMount();
void prepareSftpConnection();
void runDpkg(const QString &packageFilePath);
void runPackageInstaller(const QString &packageFilePath);
void setState(State newState);
void unmount();
void setDeviceConfig(MaemoDeviceConfig::Id internalId);
......
......@@ -58,7 +58,8 @@ static const QLatin1String binQmake("/bin/qmake" EXEC_SUFFIX);
bool MaemoGlobal::isMaemoTargetId(const QString &id)
{
return id == QLatin1String(Constants::MAEMO5_DEVICE_TARGET_ID)
|| id == QLatin1String(Constants::HARMATTAN_DEVICE_TARGET_ID);
|| id == QLatin1String(Constants::HARMATTAN_DEVICE_TARGET_ID)
|| id == QLatin1String(Constants::MEEGO_DEVICE_TARGET_ID);
}
bool MaemoGlobal::isValidMaemo5QtVersion(const QtVersion *version)
......@@ -71,6 +72,11 @@ bool MaemoGlobal::isValidHarmattanQtVersion(const QtVersion *version)
return isValidMaemoQtVersion(version, Maemo6);
}
bool MaemoGlobal::isValidMeegoQtVersion(const Qt4ProjectManager::QtVersion *version)
{
return isValidMaemoQtVersion(version, Meego);
}
bool MaemoGlobal::isValidMaemoQtVersion(const QtVersion *qtVersion,
MaemoVersion maemoVersion)
{
......@@ -188,9 +194,26 @@ MaemoGlobal::MaemoVersion MaemoGlobal::version(const QtVersion *qtVersion)
return Maemo5;
if (name.startsWith(QLatin1String("harmattan")))
return Maemo6;
if (name.startsWith(QLatin1String("meego")))
return Meego;
return static_cast<MaemoVersion>(-1);
}
QString MaemoGlobal::architecture(const QtVersion *qtVersion)
{
QProcess proc;
const QStringList args = QStringList() << QLatin1String("-t")
<< targetName(qtVersion) << QLatin1String("uname")
<< QLatin1String("-m");
if (!callMad(proc, args, qtVersion))
return QString();
if (!proc.waitForFinished())
return QString();
QString arch = QString::fromUtf8(proc.readAllStandardOutput());
arch.chop(1); // Newline
return arch;
}
bool MaemoGlobal::removeRecursively(const QString &filePath, QString &error)
{
error.clear();
......
......@@ -61,7 +61,7 @@ class MaemoGlobal
{
Q_DECLARE_TR_FUNCTIONS(Qt4ProjectManager::Internal::MaemoGlobal)
public:
enum MaemoVersion { Maemo5, Maemo6 };
enum MaemoVersion { Maemo5, Maemo6, Meego };
class FileUpdate {
public:
......@@ -74,6 +74,7 @@ public:
static bool isMaemoTargetId(const QString &id);
static bool isValidMaemo5QtVersion(const Qt4ProjectManager::QtVersion *version);
static bool isValidHarmattanQtVersion(const Qt4ProjectManager::QtVersion *version);
static bool isValidMeegoQtVersion(const Qt4ProjectManager::QtVersion *version);
static QString homeDirOnDevice(const QString &uname);
static QString remoteSudo();
......@@ -89,7 +90,9 @@ public:
static QString targetName(const QtVersion *qtVersion);
static QString madCommand(const QtVersion *qtVersion);
static MaemoVersion version(const QtVersion *qtVersion);
static QString architecture(const QtVersion *version);
// TODO: Provide version that inserts "-t <target>" itself.
static bool callMad(QProcess &proc, const QStringList &args,
const QtVersion *qtVersion);
static bool callMadAdmin(QProcess &proc, const QStringList &args,
......
......@@ -119,5 +119,10 @@ ToolChain* MaemoManager::harmattanToolChain(const QtVersion *version) const
return new HarmattanToolChain(version);
}
ToolChain* MaemoManager::meegoToolChain(const QtVersion *version) const
{
return new MeegoToolChain(version);
}
} // namespace Internal
} // namespace Qt4ProjectManager
......@@ -66,6 +66,7 @@ public:
ToolChain *maemo5ToolChain(const Qt4ProjectManager::QtVersion *version) const;
ToolChain *harmattanToolChain(const Qt4ProjectManager::QtVersion *version) const;
ToolChain *meegoToolChain(const Qt4ProjectManager::QtVersion *version) const;
MaemoDeviceConfigurationsSettingsPage *deviceConfigurationsSettingsPage() const { return m_deviceConfigurationsSettingsPage; }
MaemoQemuSettingsPage *qemuSettingsPage() const { return m_qemuSettingsPage; }
......
......@@ -168,15 +168,20 @@ bool MaemoPackageCreationStep::createPackage(QProcess *buildProc)
= buildConfiguration()->target()->project()->projectDirectory();
const bool inSourceBuild
= QFileInfo(buildDirectory()) == QFileInfo(projectDir);
if (!copyDebianFiles(inSourceBuild))
if (debBasedMaemoTarget() && !copyDebianFiles(inSourceBuild))
return false;
const QtVersion * const qtVersion = qt4BuildConfiguration()->qtVersion();
const QString madCommand = MaemoGlobal::madCommand(qtVersion);
const QStringList args = QStringList() << QLatin1String("-t")
<< MaemoGlobal::targetName(qtVersion)
<< QLatin1String("dpkg-buildpackage") << QLatin1String("-nc")
<< QLatin1String("-uc") << QLatin1String("-us");
QStringList args = QStringList() << QLatin1String("-t")
<< MaemoGlobal::targetName(qtVersion);
if (debBasedMaemoTarget()) {
args << QLatin1String("dpkg-buildpackage") << QLatin1String("-nc")
<< QLatin1String("-uc") << QLatin1String("-us");
} else {
args << QLatin1String("rrpmbuild") << QLatin1String("-bb")
<< rpmBasedMaemoTarget()->specFilePath();
}
const QString cmdLine = madCommand + QLatin1Char(' ')
+ args.join(QLatin1String(" "));
emit addOutput(tr("Package Creation: Running command '%1'.").arg(cmdLine),
......@@ -201,40 +206,49 @@ bool MaemoPackageCreationStep::createPackage(QProcess *buildProc)
return false;
}
// Workaround for non-working dh_builddeb --destdir=.
if (!QDir(buildDirectory()).isRoot()) {
const AbstractQt4MaemoTarget * const target = maemoTarget();
const ProjectExplorer::Project * const project = target->project();
QString error;
const QString pkgFileName = packageFileName(project,
target->projectVersion(&error));
if (!error.isEmpty())
raiseError(tr("Packaging failed."), error);
const QString changesSourceFileName = QFileInfo(pkgFileName).completeBaseName()
+ QLatin1String(".changes");
const QString changesTargetFileName = replaceDots(QFileInfo(pkgFileName).completeBaseName())
+ QLatin1String(".changes");
const QString packageSourceDir = buildDirectory() + QLatin1String("/../");
const QString packageSourceFilePath
= packageSourceDir + pkgFileName;
const QString changesSourceFilePath
= packageSourceDir + changesSourceFileName;
const QString changesTargetFilePath
= buildDirectory() + QLatin1Char('/') + changesTargetFileName;
QFile::remove(packageFilePath());
QFile::remove(changesTargetFilePath);
if (!QFile::rename(packageSourceFilePath, packageFilePath())
|| !QFile::rename(changesSourceFilePath, changesTargetFilePath)) {
QFile::remove(packageFilePath());
if (debBasedMaemoTarget()) {
// Workaround for non-working dh_builddeb --destdir=.
if (!QDir(buildDirectory()).isRoot()) {
const AbstractQt4MaemoTarget * const target = maemoTarget();
QString error;
const QString pkgFileName = target->packageFileName();
if (!error.isEmpty())
raiseError(tr("Packaging failed."), "Failed to get package name.");
const QString changesSourceFileName = QFileInfo(pkgFileName).completeBaseName()
+ QLatin1String(".changes");
const QString changesTargetFileName = replaceDots(QFileInfo(pkgFileName).completeBaseName())
+ QLatin1String(".changes");
const QString packageSourceDir = buildDirectory() + QLatin1String("/../");
const QString packageSourceFilePath
= packageSourceDir + pkgFileName;
const QString changesSourceFilePath
= packageSourceDir + changesSourceFileName;
const QString changesTargetFilePath
= buildDirectory() + QLatin1Char('/') + changesTargetFileName;
QFile::remove(changesTargetFilePath);
if (!QFile::rename(packageSourceFilePath, packageFilePath())
|| !QFile::rename(changesSourceFilePath, changesTargetFilePath)) {
raiseError(tr("Packaging failed."),
tr("Could not move package files from %1 to %2.")
.arg(packageSourceDir, buildDirectory()));
return false;
}
}
} else {
const QString packageSourceFilePath = rpmBuildDir(qt4BuildConfiguration())
+ QLatin1Char('/') + rpmBasedMaemoTarget()->packageFileName();
if (!QFile::rename(packageSourceFilePath, packageFilePath())) {
raiseError(tr("Packaging failed."),
tr("Could not move package files from %1 to %2.")
.arg(packageSourceDir, buildDirectory()));
tr("Could not move package file from %1 to %2.")
.arg(packageSourceFilePath, packageFilePath()));
return false;
}
}
emit addOutput(tr("Package created."), BuildStep::MessageOutput);
deployStep()->deployables()->setUnmodified();
if (inSourceBuild) {
if (inSourceBuild && debBasedMaemoTarget()) {
buildProc->start(packagingCommand(qt4BuildConfiguration(),
QLatin1String("dh_clean")));
buildProc->waitForFinished();
......@@ -341,6 +355,11 @@ AbstractDebBasedQt4MaemoTarget *MaemoPackageCreationStep::debBasedMaemoTarget()
return qobject_cast<AbstractDebBasedQt4MaemoTarget*>(buildConfiguration()->target());
}
AbstractRpmBasedQt4MaemoTarget *MaemoPackageCreationStep::rpmBasedMaemoTarget() const
{
return qobject_cast<AbstractRpmBasedQt4MaemoTarget*>(buildConfiguration()->target());
}
QString MaemoPackageCreationStep::buildDirectory() const
{
return qt4BuildConfiguration()->buildDirectory();
......@@ -388,7 +407,10 @@ bool MaemoPackageCreationStep::packagingNeeded() const
return true;
}
} else {
// TODO: Check spec file date.
const QDateTime specFileChangeDate
= QFileInfo(rpmBasedMaemoTarget()->specFilePath()).lastModified();
if (packageInfo.lastModified() <= specFileChangeDate)
return true;
}
return false;
......@@ -419,9 +441,10 @@ QString MaemoPackageCreationStep::packageFilePath() const
const QString &version = versionString(&error);
if (version.isEmpty())
return QString();
return buildDirectory() % '/'
% packageFileName(buildConfiguration()->target()->project(),
replaceDots(version));
QFileInfo fi(maemoTarget()->packageFileName());
const QString baseName = replaceDots(fi.completeBaseName());
return buildDirectory() + QLatin1Char('/') + baseName
+ QLatin1Char('.') + fi.suffix();
}
bool MaemoPackageCreationStep::isPackagingEnabled() const
......@@ -490,7 +513,6 @@ bool MaemoPackageCreationStep::preparePackagingProcess(QProcess *proc,
#endif
env.set(QLatin1String("PERL5LIB"), perlLib);
env.set(QLatin1String("PWD"), workingDir);
const QRegExp envPattern(QLatin1String("([^=]+)=[\"']?([^;\"']+)[\"']? ;.*"));
QByteArray line;
do {
......@@ -517,36 +539,16 @@ QString MaemoPackageCreationStep::packagingCommand(const Qt4BuildConfiguration *
void MaemoPackageCreationStep::checkProjectName()
{
const QRegExp legalName(QLatin1String("[0-9-+a-z\\.]+"));
if (!legalName.exactMatch(buildConfiguration()->target()->project()->displayName())) {
emit addTask(Task(Task::Warning,
tr("Your project name contains characters not allowed in Debian packages.\n"
"They must only use lower-case letters, numbers, '-', '+' and '.'.\n"
"We will try to work around that, but you may experience problems."),
QString(), -1, TASK_CATEGORY_BUILDSYSTEM));
}
}
QString MaemoPackageCreationStep::packageName(const ProjectExplorer::Project *project)
{
QString packageName = project->displayName().toLower();
// We also replace dots, because OVI store chokes on them.
const QRegExp legalLetter(QLatin1String("[a-z0-9+-]"), Qt::CaseSensitive,
QRegExp::WildcardUnix);
for (int i = 0; i < packageName.length(); ++i) {
if (!legalLetter.exactMatch(packageName.mid(i, 1)))
packageName[i] = QLatin1Char('-');
if (debBasedMaemoTarget()) {
const QRegExp legalName(QLatin1String("[0-9-+a-z\\.]+"));
if (!legalName.exactMatch(buildConfiguration()->target()->project()->displayName())) {
emit addTask(Task(Task::Warning,
tr("Your project name contains characters not allowed in Debian packages.\n"
"They must only use lower-case letters, numbers, '-', '+' and '.'.\n"
"We will try to work around that, but you may experience problems."),
QString(), -1, TASK_CATEGORY_BUILDSYSTEM));
}
}
return packageName;
}
QString MaemoPackageCreationStep::packageFileName(const ProjectExplorer::Project *project,
const QString &version)
{
return packageName(project) % QLatin1Char('_') % version
% QLatin1String("_armel.deb");
}
void MaemoPackageCreationStep::ensureShlibdeps(QByteArray &rulesContent)
......@@ -657,6 +659,11 @@ QString MaemoPackageCreationStep::replaceDots(const QString &name)
return adaptedName.replace(QLatin1Char('.'), QLatin1Char('_'));
}
QString MaemoPackageCreationStep::rpmBuildDir(const Qt4BuildConfiguration *bc)
{
return bc->buildDirectory() + QLatin1String("/rrpmbuild");
}
const QLatin1String MaemoPackageCreationStep::CreatePackageId("Qt4ProjectManager.MaemoPackageCreationStep");
} // namespace Internal
......
......@@ -58,6 +58,7 @@ class MaemoDeployStep;
class MaemoDeployableListModel;
class AbstractQt4MaemoTarget;
class AbstractDebBasedQt4MaemoTarget;
class AbstractRpmBasedQt4MaemoTarget;
class MaemoPackageCreationStep : public ProjectExplorer::BuildStep
{
......@@ -79,15 +80,13 @@ public:
QString *error);
static QString packagingCommand(const Qt4BuildConfiguration *bc,
const QString &commandName);
static QString packageName(const ProjectExplorer::Project *project);
static QString packageFileName(const ProjectExplorer::Project *project,
const QString &version);
static void ensureShlibdeps(QByteArray &rulesContent);
QString projectName() const;
const Qt4BuildConfiguration *qt4BuildConfiguration() const;
AbstractQt4MaemoTarget *maemoTarget() const;
AbstractDebBasedQt4MaemoTarget *debBasedMaemoTarget() const;
AbstractRpmBasedQt4MaemoTarget *rpmBasedMaemoTarget() const;
static const QLatin1String DefaultVersionNumber;
......@@ -130,6 +129,7 @@ private:
const QString &desktopFilePath, const QByteArray &oldString,
const QByteArray &newString);
static QString replaceDots(const QString &name);
static QString rpmBuildDir(const Qt4BuildConfiguration *bc);
static const QLatin1String CreatePackageId;
......
......@@ -84,21 +84,23 @@ void MaemoPackageCreationWidget::init()
void MaemoPackageCreationWidget::initGui()
{
const Qt4BuildConfiguration * const bc = m_step->qt4BuildConfiguration();
if (bc) {
m_ui->skipCheckBox->setVisible(m_step->maemoTarget()->allowsPackagingDisabling());
m_ui->skipCheckBox->setChecked(!m_step->isPackagingEnabled());
// The "remove" stuff below is fragile; be careful when editing the UI file.
m_ui->skipCheckBox->setChecked(!m_step->isPackagingEnabled());
if (!m_step->maemoTarget()->allowsPackagingDisabling()) {
m_ui->skipCheckBox->hide();
m_ui->formLayout->removeItem(m_ui->formLayout->itemAt(0, QFormLayout::FieldRole));
}
updateDebianFileList();
m_ui->shortDescriptionLineEdit->setMaxLength(60);
updateVersionInfo();
handleControlFileUpdate();
connect(m_step, SIGNAL(packageFilePathChanged()), this,
SIGNAL(updateSummary()));
versionInfoChanged();
const AbstractDebBasedQt4MaemoTarget * const debBasedMaemoTarget
= m_step->debBasedMaemoTarget();
if (debBasedMaemoTarget) {
m_ui->editSpecFileButton->setVisible(false);
updateDebianFileList();
handleControlFileUpdate();
connect(m_ui->packageManagerNameLineEdit, SIGNAL(editingFinished()),
SLOT(setPackageManagerName()));
connect(debBasedMaemoTarget, SIGNAL(debianDirContentsChanged()),
SLOT(updateDebianFileList()));
connect(debBasedMaemoTarget, SIGNAL(changeLogChanged()),
......@@ -106,10 +108,29 @@ void MaemoPackageCreationWidget::initGui()
connect(debBasedMaemoTarget, SIGNAL(controlChanged()),
SLOT(handleControlFileUpdate()));
} else {
// TODO: Connect the respective signals for RPM-based target
m_ui->packageManagerNameLabel->hide();
m_ui->packageManagerNameLineEdit->hide();
m_ui->packageManagerIconLabel->hide();
m_ui->packageManagerIconButton->hide();
m_ui->editDebianFileLabel->hide();
m_ui->debianFilesComboBox->hide();
m_ui->editDebianFileButton->hide();
m_ui->formLayout->removeItem(m_ui->formLayout->itemAt(5, QFormLayout::LabelRole));
m_ui->formLayout->removeItem(m_ui->formLayout->itemAt(5, QFormLayout::FieldRole));
m_ui->formLayout->removeItem(m_ui->formLayout->itemAt(6, QFormLayout::LabelRole));
m_ui->formLayout->removeItem(m_ui->formLayout->itemAt(6, QFormLayout::FieldRole));
m_ui->formLayout->removeItem(m_ui->formLayout->itemAt(7, QFormLayout::LabelRole));
m_ui->formLayout->removeItem(m_ui->formLayout->itemAt(7, QFormLayout::FieldRole));
handleSpecFileUpdate();
connect(m_step->rpmBasedMaemoTarget(), SIGNAL(specFileChanged()),
SLOT(handleSpecFileUpdate()));
connect(m_ui->editSpecFileButton, SIGNAL(clicked()),
SLOT(editSpecFile()));
}
connect(m_ui->nameLineEdit, SIGNAL(editingFinished()), SLOT(setName()));
m_ui->shortDescriptionLineEdit->setMaxLength(60);
connect(m_step, SIGNAL(packageFilePathChanged()), this,
SIGNAL(updateSummary()));
connect(m_ui->packageNameLineEdit, SIGNAL(editingFinished()),
SLOT(setPackageName()));
connect(m_ui->shortDescriptionLineEdit, SIGNAL(editingFinished()),
SLOT(setShortDescription()));
}
......@@ -142,9 +163,19 @@ void MaemoPackageCreationWidget::updateVersionInfo()
void MaemoPackageCreationWidget::handleControlFileUpdate()
{
updatePackageName();
updateShortDescription();
updatePackageManagerName();
updatePackageManagerIcon();
updateName();
updateSummary();
}
void MaemoPackageCreationWidget::handleSpecFileUpdate()
{
updatePackageName();
updateShortDescription();
updateVersionInfo();
updateSummary();
}
void MaemoPackageCreationWidget::updatePackageManagerIcon()
......@@ -159,9 +190,14 @@ void MaemoPackageCreationWidget::updatePackageManagerIcon()
}
}
void MaemoPackageCreationWidget::updateName()
void MaemoPackageCreationWidget::updatePackageName()
{
m_ui->nameLineEdit->setText(m_step->maemoTarget()->name());
m_ui->packageNameLineEdit->setText(m_step->maemoTarget()->packageName());
}