forked from qt-creator/qt-creator
Maemo: Add simple widget for package configuration.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
<?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><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Package contents:</span></p></body></html></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
|
||||
|
||||
Reference in New Issue
Block a user