#include <QtCore/QStringBuilder>
#include <QtGui/QWidget>
+namespace { const QLatin1String PackagingEnabledKey("Packaging Enabled"); }
+
using namespace ProjectExplorer::Constants;
using ProjectExplorer::BuildConfiguration;
using ProjectExplorer::BuildStepConfigWidget;
MaemoPackageCreationStep::MaemoPackageCreationStep(BuildConfiguration *buildConfig)
: ProjectExplorer::BuildStep(buildConfig, CreatePackageId),
- m_packageContents(new MaemoPackageContents(this))
+ m_packageContents(new MaemoPackageContents(this)),
+ m_packagingEnabled(true)
{
}
MaemoPackageCreationStep::MaemoPackageCreationStep(BuildConfiguration *buildConfig,
MaemoPackageCreationStep *other)
: BuildStep(buildConfig, other),
- m_packageContents(new MaemoPackageContents(this))
+ m_packageContents(new MaemoPackageContents(this)),
+ m_packagingEnabled(other->m_packagingEnabled)
{
QVariantMap MaemoPackageCreationStep::toMap() const
{
QVariantMap map(ProjectExplorer::BuildStep::toMap());
+ map.insert(PackagingEnabledKey, m_packagingEnabled);
return map.unite(m_packageContents->toMap());
}
bool MaemoPackageCreationStep::fromMap(const QVariantMap &map)
{
m_packageContents->fromMap(map);
+ m_packagingEnabled = map.value(PackagingEnabledKey, true).toBool();
return ProjectExplorer::BuildStep::fromMap(map);
}
void MaemoPackageCreationStep::run(QFutureInterface<bool> &fi)
{
- fi.reportResult(createPackage());
+ fi.reportResult(m_packagingEnabled ? createPackage() : true);
}
BuildStepConfigWidget *MaemoPackageCreationStep::createConfigWidget()
QString executableFileName() const;
MaemoPackageContents *packageContents() const { return m_packageContents; }
+ bool isPackagingEnabled() const { return m_packagingEnabled; }
+ void setPackagingEnabled(bool enabled) { m_packagingEnabled = enabled; }
+
private:
MaemoPackageCreationStep(ProjectExplorer::BuildConfiguration *buildConfig,
MaemoPackageCreationStep *other);
static const QLatin1String CreatePackageId;
MaemoPackageContents *const m_packageContents;
+ bool m_packagingEnabled;
};
} // namespace Internal
m_ui(new Ui::MaemoPackageCreationWidget)
{
m_ui->setupUi(this);
+ m_ui->skipCheckBox->setChecked(!m_step->isPackagingEnabled());
+ m_ui->packageContentsView->setEnabled(m_step->isPackagingEnabled());
m_ui->packageContentsView->setModel(step->packageContents());
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
connect(step->packageContents(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
&& selectedRows.first().row() != 0);
}
+void MaemoPackageCreationWidget::handleSkipButtonToggled(bool checked)
+{
+ m_step->setPackagingEnabled(!checked);
+ m_ui->packageContentsView->setEnabled(m_step->isPackagingEnabled());
+}
+
} // namespace Internal
} // namespace Qt4ProjectManager
void addFile();
void removeFile();
void enableOrDisableRemoveButton();
+ void handleSkipButtonToggled(bool checked);
private:
MaemoPackageCreationStep * const m_step;
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QCheckBox" name="skipCheckBox">
+ <property name="toolTip">
+ <string>Check this if you build the package externally. It still needs to be at the location listed above
+and the remote executable is assumed to be in the directory mentioned below.</string>
+ </property>
+ <property name="text">
+ <string>Skip Packaging Step</string>
+ </property>
+ </widget>
+ </item>
<item>
<widget class="QLabel" name="contentsLabel">
<property name="font">
<slot>addFile()</slot>
<hints>
<hint type="sourcelabel">
- <x>712</x>
- <y>44</y>
+ <x>729</x>
+ <y>88</y>
</hint>
<hint type="destinationlabel">
<x>732</x>
<slot>removeFile()</slot>
<hints>
<hint type="sourcelabel">
- <x>723</x>
- <y>77</y>
+ <x>729</x>
+ <y>124</y>
</hint>
<hint type="destinationlabel">
<x>735</x>
</hint>
</hints>
</connection>
+ <connection>
+ <sender>skipCheckBox</sender>
+ <signal>clicked(bool)</signal>
+ <receiver>MaemoPackageCreationWidget</receiver>
+ <slot>handleSkipButtonToggled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>129</x>
+ <y>18</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>240</x>
+ <y>31</y>
+ </hint>
+ </hints>
+ </connection>
</connections>
<slots>
<slot>addFile()</slot>
<slot>removeFile()</slot>
+ <slot>handleSkipButtonToggled(bool)</slot>
</slots>
</ui>