forked from qt-creator/qt-creator
Maemo: Watch Debian files and update packaging GUI accordingly.
Reviewed-by: kh1
This commit is contained in:
@@ -74,6 +74,40 @@ void MaemoPackageCreationWidget::init()
|
|||||||
|
|
||||||
void MaemoPackageCreationWidget::initGui()
|
void MaemoPackageCreationWidget::initGui()
|
||||||
{
|
{
|
||||||
|
const ProjectExplorer::Project * const project
|
||||||
|
= m_step->buildConfiguration()->target()->project();
|
||||||
|
updateDebianFileList(project);
|
||||||
|
updateVersionInfo(project);
|
||||||
|
connect(m_step, SIGNAL(packageFilePathChanged()), this,
|
||||||
|
SIGNAL(updateSummary()));
|
||||||
|
versionInfoChanged();
|
||||||
|
connect(MaemoTemplatesManager::instance(),
|
||||||
|
SIGNAL(debianDirContentsChanged(const ProjectExplorer::Project*)),
|
||||||
|
this, SLOT(updateDebianFileList(const ProjectExplorer::Project*)));
|
||||||
|
connect(MaemoTemplatesManager::instance(),
|
||||||
|
SIGNAL(changeLogChanged(const ProjectExplorer::Project*)), this,
|
||||||
|
SLOT(updateVersionInfo(const ProjectExplorer::Project*)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaemoPackageCreationWidget::updateDebianFileList(const ProjectExplorer::Project *project)
|
||||||
|
{
|
||||||
|
const ProjectExplorer::Project * const ourProject
|
||||||
|
= m_step->buildConfiguration()->target()->project();
|
||||||
|
if (ourProject == project)
|
||||||
|
m_ui->debianFilesComboBox->clear();
|
||||||
|
const QStringList &debianFiles = MaemoTemplatesManager::instance()
|
||||||
|
->debianFiles(project);
|
||||||
|
foreach (const QString &fileName, debianFiles) {
|
||||||
|
if (fileName != QLatin1String("compat"))
|
||||||
|
m_ui->debianFilesComboBox->addItem(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaemoPackageCreationWidget::updateVersionInfo(const ProjectExplorer::Project *project)
|
||||||
|
{
|
||||||
|
if (project != m_step->buildConfiguration()->target()->project())
|
||||||
|
return;
|
||||||
|
|
||||||
QString error;
|
QString error;
|
||||||
QString versionString = m_step->versionString(&error);
|
QString versionString = m_step->versionString(&error);
|
||||||
if (versionString.isEmpty()) {
|
if (versionString.isEmpty()) {
|
||||||
@@ -85,16 +119,6 @@ void MaemoPackageCreationWidget::initGui()
|
|||||||
m_ui->major->setValue(list.value(0, QLatin1String("0")).toInt());
|
m_ui->major->setValue(list.value(0, QLatin1String("0")).toInt());
|
||||||
m_ui->minor->setValue(list.value(1, QLatin1String("0")).toInt());
|
m_ui->minor->setValue(list.value(1, QLatin1String("0")).toInt());
|
||||||
m_ui->patch->setValue(list.value(2, QLatin1String("0")).toInt());
|
m_ui->patch->setValue(list.value(2, QLatin1String("0")).toInt());
|
||||||
connect(m_step, SIGNAL(packageFilePathChanged()), this,
|
|
||||||
SIGNAL(updateSummary()));
|
|
||||||
versionInfoChanged();
|
|
||||||
|
|
||||||
const QStringList &debianFiles = MaemoTemplatesManager::instance()
|
|
||||||
->debianFiles(m_step->buildConfiguration()->target()->project());
|
|
||||||
foreach (const QString &fileName, debianFiles) {
|
|
||||||
if (fileName != QLatin1String("compat"))
|
|
||||||
m_ui->debianFilesComboBox->addItem(fileName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaemoPackageCreationWidget::summaryText() const
|
QString MaemoPackageCreationWidget::summaryText() const
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ private slots:
|
|||||||
void editDebianFile();
|
void editDebianFile();
|
||||||
void versionInfoChanged();
|
void versionInfoChanged();
|
||||||
void initGui();
|
void initGui();
|
||||||
|
void updateDebianFileList(const ProjectExplorer::Project *project);
|
||||||
|
void updateVersionInfo(const ProjectExplorer::Project *project);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MaemoPackageCreationStep * const m_step;
|
MaemoPackageCreationStep * const m_step;
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
|
|
||||||
#include "maemorunconfigurationwidget.h"
|
#include "maemorunconfigurationwidget.h"
|
||||||
|
|
||||||
|
#include "maemodeployables.h"
|
||||||
|
#include "maemodeploystep.h"
|
||||||
#include "maemodeviceconfiglistmodel.h"
|
#include "maemodeviceconfiglistmodel.h"
|
||||||
#include "maemodeviceenvreader.h"
|
#include "maemodeviceenvreader.h"
|
||||||
#include "maemomanager.h"
|
#include "maemomanager.h"
|
||||||
@@ -104,8 +106,12 @@ void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
|
|||||||
devConfLayout->addWidget(debuggerConfLabel);
|
devConfLayout->addWidget(debuggerConfLabel);
|
||||||
|
|
||||||
formLayout->addRow(new QLabel(tr("Device configuration:")), devConfWidget);
|
formLayout->addRow(new QLabel(tr("Device configuration:")), devConfWidget);
|
||||||
m_executableLabel = new QLabel(m_runConfiguration->localExecutableFilePath());
|
m_localExecutableLabel
|
||||||
formLayout->addRow(tr("Executable:"), m_executableLabel);
|
= new QLabel(m_runConfiguration->localExecutableFilePath());
|
||||||
|
formLayout->addRow(tr("Executable on host:"), m_localExecutableLabel);
|
||||||
|
m_remoteExecutableLabel
|
||||||
|
= new QLabel(m_runConfiguration->remoteExecutableFilePath());
|
||||||
|
formLayout->addRow(tr("Executable on device:"), m_remoteExecutableLabel);
|
||||||
m_argsLineEdit = new QLineEdit(m_runConfiguration->arguments().join(" "));
|
m_argsLineEdit = new QLineEdit(m_runConfiguration->arguments().join(" "));
|
||||||
formLayout->addRow(tr("Arguments:"), m_argsLineEdit);
|
formLayout->addRow(tr("Arguments:"), m_argsLineEdit);
|
||||||
|
|
||||||
@@ -123,6 +129,8 @@ void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
|
|||||||
this, SLOT(handleCurrentDeviceConfigChanged()));
|
this, SLOT(handleCurrentDeviceConfigChanged()));
|
||||||
connect(m_runConfiguration, SIGNAL(targetInformationChanged()), this,
|
connect(m_runConfiguration, SIGNAL(targetInformationChanged()), this,
|
||||||
SLOT(updateTargetInformation()));
|
SLOT(updateTargetInformation()));
|
||||||
|
connect(m_runConfiguration->deployStep()->deployables(),
|
||||||
|
SIGNAL(modelsCreated()), this, SLOT(updateTargetInformation()));
|
||||||
handleCurrentDeviceConfigChanged();
|
handleCurrentDeviceConfigChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,7 +256,8 @@ void MaemoRunConfigurationWidget::argumentsEdited(const QString &text)
|
|||||||
|
|
||||||
void MaemoRunConfigurationWidget::updateTargetInformation()
|
void MaemoRunConfigurationWidget::updateTargetInformation()
|
||||||
{
|
{
|
||||||
m_executableLabel->setText(m_runConfiguration->localExecutableFilePath());
|
m_localExecutableLabel->setText(m_runConfiguration->localExecutableFilePath());
|
||||||
|
m_remoteExecutableLabel->setText(m_runConfiguration->remoteExecutableFilePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunConfigurationWidget::showSettingsDialog(const QString &link)
|
void MaemoRunConfigurationWidget::showSettingsDialog(const QString &link)
|
||||||
|
|||||||
@@ -97,7 +97,8 @@ private:
|
|||||||
|
|
||||||
QLineEdit *m_configNameLineEdit;
|
QLineEdit *m_configNameLineEdit;
|
||||||
QLineEdit *m_argsLineEdit;
|
QLineEdit *m_argsLineEdit;
|
||||||
QLabel *m_executableLabel;
|
QLabel *m_localExecutableLabel;
|
||||||
|
QLabel *m_remoteExecutableLabel;
|
||||||
QComboBox *m_devConfBox;
|
QComboBox *m_devConfBox;
|
||||||
QTableView *m_mountView;
|
QTableView *m_mountView;
|
||||||
QToolButton *m_removeMountButton;
|
QToolButton *m_removeMountButton;
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
|
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
#include <QtCore/QFile>
|
#include <QtCore/QFile>
|
||||||
|
#include <QtCore/QFileSystemWatcher>
|
||||||
#include <QtCore/QList>
|
#include <QtCore/QList>
|
||||||
#include <QtCore/QProcess>
|
#include <QtCore/QProcess>
|
||||||
#include <QtGui/QMessageBox>
|
#include <QtGui/QMessageBox>
|
||||||
@@ -65,7 +66,7 @@ MaemoTemplatesManager *MaemoTemplatesManager::instance(QObject *parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
MaemoTemplatesManager::MaemoTemplatesManager(QObject *parent) :
|
MaemoTemplatesManager::MaemoTemplatesManager(QObject *parent) :
|
||||||
QObject(parent), m_activeProject(0)
|
QObject(parent), m_activeProject(0), m_fsWatcher(0)
|
||||||
{
|
{
|
||||||
SessionManager * const session
|
SessionManager * const session
|
||||||
= ProjectExplorerPlugin::instance()->session();
|
= ProjectExplorerPlugin::instance()->session();
|
||||||
@@ -78,6 +79,8 @@ void MaemoTemplatesManager::handleActiveProjectChanged(ProjectExplorer::Project
|
|||||||
{
|
{
|
||||||
if (m_activeProject)
|
if (m_activeProject)
|
||||||
disconnect(m_activeProject, 0, this, 0);
|
disconnect(m_activeProject, 0, this, 0);
|
||||||
|
delete m_fsWatcher;
|
||||||
|
m_fsWatcher = 0;
|
||||||
m_activeProject= project;
|
m_activeProject= project;
|
||||||
if (m_activeProject) {
|
if (m_activeProject) {
|
||||||
connect(m_activeProject, SIGNAL(addedTarget(ProjectExplorer::Target*)),
|
connect(m_activeProject, SIGNAL(addedTarget(ProjectExplorer::Target*)),
|
||||||
@@ -88,6 +91,17 @@ void MaemoTemplatesManager::handleActiveProjectChanged(ProjectExplorer::Project
|
|||||||
const QList<Target *> &targets = m_activeProject->targets();
|
const QList<Target *> &targets = m_activeProject->targets();
|
||||||
foreach (Target * const target, targets)
|
foreach (Target * const target, targets)
|
||||||
createTemplatesIfNecessary(target);
|
createTemplatesIfNecessary(target);
|
||||||
|
m_fsWatcher = new QFileSystemWatcher(this);
|
||||||
|
const QString &debianPath = debianDirPath(m_activeProject);
|
||||||
|
const QString changeLogPath = debianPath + QLatin1String("/changelog");
|
||||||
|
m_fsWatcher->addPath(debianPath);
|
||||||
|
m_fsWatcher->addPath(changeLogPath);
|
||||||
|
connect(m_fsWatcher, SIGNAL(directoryChanged(QString)), this,
|
||||||
|
SLOT(handleDebianDirContentsChanged()));
|
||||||
|
connect(m_fsWatcher, SIGNAL(fileChanged(QString)), this,
|
||||||
|
SLOT(handleChangeLogChanged()));
|
||||||
|
handleDebianDirContentsChanged();
|
||||||
|
handleChangeLogChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,5 +279,15 @@ void MaemoTemplatesManager::raiseError(const QString &reason)
|
|||||||
QMessageBox::critical(0, tr("Error creating Maemo templates"), reason);
|
QMessageBox::critical(0, tr("Error creating Maemo templates"), reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MaemoTemplatesManager::handleChangeLogChanged()
|
||||||
|
{
|
||||||
|
emit changeLogChanged(m_activeProject);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaemoTemplatesManager::handleDebianDirContentsChanged()
|
||||||
|
{
|
||||||
|
emit debianDirContentsChanged(m_activeProject);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -32,6 +32,8 @@
|
|||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
|
QT_FORWARD_DECLARE_CLASS(QFileSystemWatcher);
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
class Project;
|
class Project;
|
||||||
class Target;
|
class Target;
|
||||||
@@ -57,9 +59,15 @@ public:
|
|||||||
|
|
||||||
static const QLatin1String PackagingDirName;
|
static const QLatin1String PackagingDirName;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void debianDirContentsChanged(const ProjectExplorer::Project *project);
|
||||||
|
void changeLogChanged(const ProjectExplorer::Project *project);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleActiveProjectChanged(ProjectExplorer::Project *project);
|
void handleActiveProjectChanged(ProjectExplorer::Project *project);
|
||||||
void createTemplatesIfNecessary(ProjectExplorer::Target *target);
|
void createTemplatesIfNecessary(ProjectExplorer::Target *target);
|
||||||
|
void handleDebianDirContentsChanged();
|
||||||
|
void handleChangeLogChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit MaemoTemplatesManager(QObject *parent);
|
explicit MaemoTemplatesManager(QObject *parent);
|
||||||
@@ -67,6 +75,7 @@ private:
|
|||||||
|
|
||||||
static MaemoTemplatesManager *m_instance;
|
static MaemoTemplatesManager *m_instance;
|
||||||
ProjectExplorer::Project *m_activeProject;
|
ProjectExplorer::Project *m_activeProject;
|
||||||
|
QFileSystemWatcher *m_fsWatcher;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user