Commit fd78ec9f authored by hjk's avatar hjk

rvcttoolchain: fix toolchain widget

Was broken after today's toolchain widget re-organization.
The sub-widgets now have to insert themselves into the
form layout defined by the base class.

Change-Id: Ie7a88614e222dc39e8734ab2739ff14c4604e3da
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent f1d0c375
......@@ -70,7 +70,6 @@ HEADERS += $$PWD/s60manager.h \
FORMS += $$PWD/s60createpackagestep.ui \
$$PWD/s60certificatedetailsdialog.ui \
$$PWD/rvcttoolchainconfigwidget.ui \
$$PWD/s60publishingbuildsettingspageovi.ui \
$$PWD/s60publishingresultspageovi.ui \
$$PWD/s60publishingsissettingspageovi.ui
......
......@@ -30,7 +30,6 @@
#include "rvcttoolchain.h"
#include "rvctparser.h"
#include "ui_rvcttoolchainconfigwidget.h"
#include "qt4projectmanager/qt4projectmanagerconstants.h"
#include <projectexplorer/abi.h>
......@@ -38,24 +37,30 @@
#include <projectexplorer/toolchainmanager.h>
#include <utils/environment.h>
#include <utils/environmentmodel.h>
#include <utils/pathchooser.h>
#include <utils/synchronousprocess.h>
#include <QComboBox>
#include <QDir>
#include <QFileInfo>
#include <QProcess>
#include <QFormLayout>
#include <QGridLayout>
#include <QGroupBox>
#include <QHeaderView>
#include <QLabel>
#include <QProcess>
#include <QTableView>
namespace Qt4ProjectManager {
namespace Internal {
#if defined Q_OS_WIN
static const char *const RVCT_BINARY = "armcc.exe";
static const char RVCT_BINARY[] = "armcc.exe";
#else
static const char *const RVCT_BINARY = "armcc";
static const char RVCT_BINARY[] = "armcc";
#endif
static const char *const RVCT_LICENSE_KEY = "ARMLMD_LICENSE_FILE";
static const char RVCT_LICENSE_KEY[] = "ARMLMD_LICENSE_FILE";
static const char rvctPathKeyC[] = "Qt4ProjectManager.RvctToolChain.CompilerPath";
static const char rvctEnvironmentKeyC[] = "Qt4ProjectManager.RvctToolChain.Environment";
......@@ -348,29 +353,45 @@ QString RvctToolChain::varName(const QString &postFix) const
// RvctToolChainConfigWidget
// ==========================================================================
class RvctToolChainConfigWidgetUi
{
public:
QComboBox *versionComboBox;
Utils::PathChooser *compilerPath;
QTableView *environmentView;
};
RvctToolChainConfigWidget::RvctToolChainConfigWidget(RvctToolChain *tc) :
ProjectExplorer::ToolChainConfigWidget(tc),
m_ui(new Ui::RvctToolChainConfigWidget()),
m_ui(new RvctToolChainConfigWidgetUi),
m_model(new Utils::EnvironmentModel(this))
{
m_ui->setupUi(this);
m_ui->versionComboBox = new QComboBox(this);
m_ui->versionComboBox->addItem(tr("Version 5"));
m_ui->versionComboBox->addItem(tr("Version 6"));
m_ui->compilerPath = new Utils::PathChooser(this);
m_ui->environmentView = new QTableView(this);
m_mainLayout->addRow(tr("ARM &version:"), m_ui->versionComboBox);
m_mainLayout->addRow(tr("&Compiler path:"), m_ui->compilerPath);
m_mainLayout->addRow(tr("Environment Variables"), m_ui->environmentView);
m_ui->environmentView->setModel(m_model);
m_ui->environmentView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
m_ui->environmentView->horizontalHeader()->setStretchLastSection(true);
m_ui->environmentView->setGridStyle(Qt::NoPen);
m_ui->environmentView->horizontalHeader()->setHighlightSections(false);
m_ui->environmentView->setGridStyle(Qt::NoPen);
m_ui->environmentView->verticalHeader()->hide();
QFontMetrics fm(font());
m_ui->environmentView->verticalHeader()->setDefaultSectionSize(qMax(static_cast<int>(fm.height() * 1.2), fm.height() + 4));
m_ui->environmentView->verticalHeader()->setDefaultSectionSize(qMax(int(fm.height() * 1.2), fm.height() + 4));
m_ui->environmentView->setModel(m_model);
connect(m_model, SIGNAL(userChangesChanged()), this, SLOT(emitDirty()));
connect(m_model, SIGNAL(userChangesChanged()), this, SIGNAL(dirty()));
m_ui->compilerPath->setExpectedKind(Utils::PathChooser::ExistingCommand);
m_ui->compilerPath->setFileName(tc->compilerCommand());
connect(m_ui->compilerPath, SIGNAL(changed(QString)), this, SLOT(emitDirty()));
connect(m_ui->compilerPath, SIGNAL(changed(QString)), this, SIGNAL(dirty()));
m_ui->versionComboBox->setCurrentIndex(static_cast<int>(tc->armVersion()));
connect(m_ui->versionComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(emitDirty()));
connect(m_ui->versionComboBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(dirty()));
setFromToolChain();
}
......
......@@ -43,10 +43,7 @@ class PathChooser;
namespace Qt4ProjectManager {
namespace Internal {
namespace Ui {
class RvctToolChainConfigWidget;
}
class RvctToolChainConfigWidgetUi;
class RvctToolChainFactory;
// ==========================================================================
......@@ -149,7 +146,7 @@ private:
void setFromToolChain();
QList<Utils::EnvironmentItem> environmentChanges() const;
Ui::RvctToolChainConfigWidget *m_ui;
RvctToolChainConfigWidgetUi *m_ui;
Utils::EnvironmentModel *m_model;
};
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Qt4ProjectManager::Internal::RvctToolChainConfigWidget</class>
<widget class="QWidget" name="Qt4ProjectManager::Internal::RvctToolChainConfigWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>399</width>
<height>318</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="armVersionLabel">
<property name="text">
<string>ARM &amp;version:</string>
</property>
<property name="buddy">
<cstring>versionComboBox</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="versionComboBox">
<item>
<property name="text">
<string>Version 5</string>
</property>
</item>
<item>
<property name="text">
<string>Version 6</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="compilerPathLabel">
<property name="text">
<string>&amp;Compiler path:</string>
</property>
<property name="buddy">
<cstring>compilerPath</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Utils::PathChooser" name="compilerPath"/>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>3</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QGroupBox" name="envGroupBox">
<property name="title">
<string>Environment Variables</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTableView" name="environmentView"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Utils::PathChooser</class>
<extends>QWidget</extends>
<header location="global">utils/pathchooser.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
......@@ -139,7 +139,6 @@ QtcPlugin {
"qt-desktop/simulatorqtversion.h",
"qt-desktop/simulatorqtversionfactory.cpp",
"qt-desktop/simulatorqtversionfactory.h",
"qt-s60/rvcttoolchainconfigwidget.ui",
"qt-s60/abldparser.cpp",
"qt-s60/abldparser.h",
"qt-s60/certificatepathchooser.cpp",
......
Markdown is supported
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