Commit e112c6a9 authored by ck's avatar ck
Browse files

Maemo: Add simple widget for package configuration.

parent 797bc649
......@@ -70,5 +70,13 @@ QVariant MaemoPackageContents::data(const QModelIndex &index, int role) const
return index.column() == 0 ? d.localFilePath : d.remoteFilePath;
}
QVariant MaemoPackageContents::headerData(int section,
Qt::Orientation orientation, int role) const
{
if (orientation == Qt::Vertical || role != Qt::DisplayRole)
return QVariant();
return section == 0 ? tr("Local File Path") : tr("Remote File Path");
}
} // namespace Qt4ProjectManager
} // namespace Internal
......@@ -64,6 +64,8 @@ private:
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
virtual QVariant data(const QModelIndex &index,
int role = Qt::DisplayRole) const;
virtual QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const;
// TODO: setData
......
......@@ -66,6 +66,7 @@ public:
QString packageFilePath() const;
QString remoteExecutableFilePath() const;
QString localExecutableFilePath() const;
MaemoPackageContents *packageContents() const { return m_packageContents; }
private:
MaemoPackageCreationStep(ProjectExplorer::BuildConfiguration *buildConfig,
......
......@@ -40,15 +40,28 @@
****************************************************************************/
#include "maemopackagecreationwidget.h"
#include "ui_maemopackagecreationwidget.h"
#include "maemopackagecontents.h"
#include "maemopackagecreationstep.h"
namespace Qt4ProjectManager {
namespace Internal {
MaemoPackageCreationWidget::MaemoPackageCreationWidget(MaemoPackageCreationStep *step)
: ProjectExplorer::BuildStepConfigWidget(), m_step(step)
: ProjectExplorer::BuildStepConfigWidget(),
m_step(step),
m_ui(new Ui::MaemoPackageCreationWidget)
{
m_ui->setupUi(this);
m_ui->packageContentsView->setModel(step->packageContents());
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
connect(step->packageContents(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
m_ui->packageContentsView, SLOT(resizeColumnsToContents()));
connect(step->packageContents(), SIGNAL(rowsInserted(QModelIndex, int, int)),
m_ui->packageContentsView, SLOT(resizeColumnsToContents()));
m_ui->packageContentsView->resizeColumnsToContents();
m_ui->packageContentsView->horizontalHeader()->setStretchLastSection(true);
}
void MaemoPackageCreationWidget::init()
......@@ -57,7 +70,7 @@ void MaemoPackageCreationWidget::init()
QString MaemoPackageCreationWidget::summaryText() const
{
return tr("Package Creation");
return tr("<b>Create Package:</b> ") + m_step->packageFilePath();
}
QString MaemoPackageCreationWidget::displayName() const
......
......@@ -44,6 +44,10 @@
#include <projectexplorer/buildstep.h>
QT_BEGIN_NAMESPACE
namespace Ui { class MaemoPackageCreationWidget; }
QT_END_NAMESPACE
namespace Qt4ProjectManager {
namespace Internal {
......@@ -60,6 +64,7 @@ public:
virtual QString displayName() const;
private:
MaemoPackageCreationStep * const m_step;
Ui::MaemoPackageCreationWidget * const m_ui;
};
} // namespace Internal
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MaemoPackageCreationWidget</class>
<widget class="QWidget" name="MaemoPackageCreationWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>741</width>
<height>574</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="contentsLabel">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Package contents:&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QTableView" name="packageContentsView">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="showGrid">
<bool>false</bool>
</property>
<attribute name="horizontalHeaderVisible">
<bool>true</bool>
</attribute>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
......@@ -38,6 +38,7 @@ SOURCES += \
FORMS += \
$$PWD/maemoconfigtestdialog.ui \
$$PWD/maemosettingswidget.ui \
$$PWD/maemosshconfigdialog.ui
$$PWD/maemosshconfigdialog.ui \
$$PWD/maemopackagecreationwidget.ui
RESOURCES += $$PWD/qt-maemo.qrc
Supports Markdown
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