2010-01-07 11:21:11 +01:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2010-03-05 11:25:49 +01:00
|
|
|
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
2010-01-07 11:21:11 +01:00
|
|
|
** All rights reserved.
|
|
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
|
|
|
**
|
|
|
|
|
** This file is part of the Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** $QT_BEGIN_LICENSE:LGPL$
|
|
|
|
|
** No Commercial Usage
|
|
|
|
|
** This file contains pre-release code and may not be distributed.
|
|
|
|
|
** You may use this file in accordance with the terms and conditions
|
|
|
|
|
** contained in the Technology Preview License Agreement accompanying
|
|
|
|
|
** this package.
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
|
|
|
|
** If you have questions regarding the use of this file, please contact
|
|
|
|
|
** Nokia at qt-info@nokia.com.
|
|
|
|
|
**
|
|
|
|
|
** $QT_END_LICENSE$
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "maemorunconfigurationwidget.h"
|
|
|
|
|
|
2010-08-04 16:38:37 +02:00
|
|
|
#include "maemodeployables.h"
|
|
|
|
|
#include "maemodeploystep.h"
|
2010-07-16 17:09:05 +02:00
|
|
|
#include "maemodeviceconfiglistmodel.h"
|
2010-07-28 09:36:30 +02:00
|
|
|
#include "maemodeviceenvreader.h"
|
2010-01-07 11:21:11 +01:00
|
|
|
#include "maemomanager.h"
|
2010-07-26 16:07:28 +02:00
|
|
|
#include "maemoremotemountsmodel.h"
|
2010-01-07 11:21:11 +01:00
|
|
|
#include "maemorunconfiguration.h"
|
|
|
|
|
#include "maemosettingspage.h"
|
2010-08-23 17:49:07 +02:00
|
|
|
#include "maemotoolchain.h"
|
2010-01-07 11:21:11 +01:00
|
|
|
|
2010-07-30 22:16:59 +02:00
|
|
|
#include <coreplugin/coreconstants.h>
|
2010-01-07 11:21:11 +01:00
|
|
|
#include <coreplugin/icore.h>
|
2010-07-27 17:57:16 +02:00
|
|
|
#include <projectexplorer/environmenteditmodel.h>
|
2010-08-23 17:49:07 +02:00
|
|
|
#include <qt4projectmanager/qt4buildconfiguration.h>
|
|
|
|
|
#include <qt4projectmanager/qt4target.h>
|
2010-07-29 14:35:08 +02:00
|
|
|
#include <utils/detailswidget.h>
|
2010-01-07 11:21:11 +01:00
|
|
|
|
2010-09-08 16:51:53 +02:00
|
|
|
#include <QtGui/QCheckBox>
|
2010-01-07 11:21:11 +01:00
|
|
|
#include <QtGui/QComboBox>
|
2010-07-26 16:07:28 +02:00
|
|
|
#include <QtGui/QFileDialog>
|
2010-01-07 11:21:11 +01:00
|
|
|
#include <QtGui/QFormLayout>
|
2010-07-26 16:07:28 +02:00
|
|
|
#include <QtGui/QGroupBox>
|
2010-01-07 11:21:11 +01:00
|
|
|
#include <QtGui/QHBoxLayout>
|
2010-07-26 16:07:28 +02:00
|
|
|
#include <QtGui/QHeaderView>
|
2010-01-07 11:21:11 +01:00
|
|
|
#include <QtGui/QLabel>
|
|
|
|
|
#include <QtGui/QLineEdit>
|
2010-07-27 17:57:16 +02:00
|
|
|
#include <QtGui/QPushButton>
|
2010-07-30 12:14:54 +02:00
|
|
|
#include <QtGui/QRadioButton>
|
2010-07-26 16:07:28 +02:00
|
|
|
#include <QtGui/QTableView>
|
2010-01-07 11:21:11 +01:00
|
|
|
#include <QtGui/QToolButton>
|
|
|
|
|
|
|
|
|
|
namespace Qt4ProjectManager {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
|
|
|
|
|
MaemoRunConfiguration *runConfiguration, QWidget *parent)
|
2010-07-27 17:57:16 +02:00
|
|
|
: QWidget(parent),
|
|
|
|
|
m_runConfiguration(runConfiguration),
|
2010-07-28 14:27:08 +02:00
|
|
|
m_ignoreChange(false),
|
2010-07-28 09:36:30 +02:00
|
|
|
m_deviceEnvReader(new MaemoDeviceEnvReader(this, runConfiguration))
|
2010-01-07 11:21:11 +01:00
|
|
|
{
|
2010-08-23 17:49:07 +02:00
|
|
|
m_lastActiveBuildConfig = m_runConfiguration->activeQt4BuildConfiguration();
|
2010-07-26 16:07:28 +02:00
|
|
|
QVBoxLayout *mainLayout = new QVBoxLayout;
|
2010-01-07 11:21:11 +01:00
|
|
|
setLayout(mainLayout);
|
2010-07-30 12:14:54 +02:00
|
|
|
addGenericWidgets(mainLayout);
|
|
|
|
|
mainLayout->addSpacing(20);
|
|
|
|
|
addDebuggingWidgets(mainLayout);
|
|
|
|
|
addMountWidgets(mainLayout);
|
|
|
|
|
addEnvironmentWidgets(mainLayout);
|
2010-08-17 08:46:01 +02:00
|
|
|
connect(m_runConfiguration,
|
|
|
|
|
SIGNAL(deviceConfigurationChanged(ProjectExplorer::Target*)),
|
2010-08-13 15:25:22 +02:00
|
|
|
this, SLOT(handleCurrentDeviceConfigChanged()));
|
|
|
|
|
handleCurrentDeviceConfigChanged();
|
2010-08-23 17:49:07 +02:00
|
|
|
connect(m_runConfiguration->qt4Target(),
|
|
|
|
|
SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
|
|
|
|
|
this, SLOT(handleBuildConfigChanged()));
|
|
|
|
|
handleBuildConfigChanged();
|
2010-07-30 12:14:54 +02:00
|
|
|
}
|
2010-01-07 11:21:11 +01:00
|
|
|
|
2010-07-30 12:14:54 +02:00
|
|
|
void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
|
|
|
|
|
{
|
2010-07-26 16:07:28 +02:00
|
|
|
QFormLayout *formLayout = new QFormLayout;
|
|
|
|
|
mainLayout->addLayout(formLayout);
|
|
|
|
|
formLayout->setFormAlignment(Qt::AlignLeft | Qt::AlignVCenter);
|
2010-03-31 18:28:04 +02:00
|
|
|
|
2010-01-07 11:21:11 +01:00
|
|
|
QWidget *devConfWidget = new QWidget;
|
|
|
|
|
QHBoxLayout *devConfLayout = new QHBoxLayout(devConfWidget);
|
2010-08-17 08:46:01 +02:00
|
|
|
m_devConfLabel = new QLabel;
|
2010-02-03 15:20:12 +01:00
|
|
|
devConfLayout->setMargin(0);
|
2010-08-17 08:46:01 +02:00
|
|
|
devConfLayout->addWidget(m_devConfLabel);
|
2010-03-31 18:28:04 +02:00
|
|
|
QLabel *addDevConfLabel= new QLabel(tr("<a href=\"%1\">Manage device configurations</a>")
|
|
|
|
|
.arg(QLatin1String("deviceconfig")));
|
2010-04-09 16:52:15 +02:00
|
|
|
addDevConfLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
|
2010-01-07 11:21:11 +01:00
|
|
|
devConfLayout->addWidget(addDevConfLabel);
|
2010-07-28 14:27:08 +02:00
|
|
|
|
2010-04-09 16:52:15 +02:00
|
|
|
QLabel *debuggerConfLabel = new QLabel(tr("<a href=\"%1\">Set Debugger</a>")
|
|
|
|
|
.arg(QLatin1String("debugger")));
|
|
|
|
|
debuggerConfLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
|
|
|
|
|
devConfLayout->addWidget(debuggerConfLabel);
|
2010-03-31 18:28:04 +02:00
|
|
|
|
2010-07-26 16:07:28 +02:00
|
|
|
formLayout->addRow(new QLabel(tr("Device configuration:")), devConfWidget);
|
2010-08-04 16:38:37 +02:00
|
|
|
m_localExecutableLabel
|
|
|
|
|
= new QLabel(m_runConfiguration->localExecutableFilePath());
|
|
|
|
|
formLayout->addRow(tr("Executable on host:"), m_localExecutableLabel);
|
2010-08-05 11:22:07 +02:00
|
|
|
m_remoteExecutableLabel = new QLabel;
|
2010-08-04 16:38:37 +02:00
|
|
|
formLayout->addRow(tr("Executable on device:"), m_remoteExecutableLabel);
|
2010-01-07 11:21:11 +01:00
|
|
|
m_argsLineEdit = new QLineEdit(m_runConfiguration->arguments().join(" "));
|
2010-07-26 16:07:28 +02:00
|
|
|
formLayout->addRow(tr("Arguments:"), m_argsLineEdit);
|
|
|
|
|
|
2010-09-08 16:51:53 +02:00
|
|
|
m_qmlCheckBox = new QCheckBox(tr("Also debug QML parts"));
|
|
|
|
|
m_qmlCheckBox->setChecked(m_runConfiguration->useQmlDebugger());
|
|
|
|
|
formLayout->addRow(new QLabel(tr("Debugging:")), m_qmlCheckBox);
|
|
|
|
|
|
2010-07-30 12:14:54 +02:00
|
|
|
connect(addDevConfLabel, SIGNAL(linkActivated(QString)), this,
|
|
|
|
|
SLOT(showSettingsDialog(QString)));
|
|
|
|
|
connect(debuggerConfLabel, SIGNAL(linkActivated(QString)), this,
|
|
|
|
|
SLOT(showSettingsDialog(QString)));
|
|
|
|
|
connect(m_argsLineEdit, SIGNAL(textEdited(QString)), this,
|
|
|
|
|
SLOT(argumentsEdited(QString)));
|
2010-09-08 16:51:53 +02:00
|
|
|
connect(m_qmlCheckBox, SIGNAL(toggled(bool)), this,
|
|
|
|
|
SLOT(handleQmlDebuggingChanged(bool)));
|
2010-07-30 12:14:54 +02:00
|
|
|
connect(m_runConfiguration, SIGNAL(targetInformationChanged()), this,
|
|
|
|
|
SLOT(updateTargetInformation()));
|
2010-08-04 16:38:37 +02:00
|
|
|
connect(m_runConfiguration->deployStep()->deployables(),
|
2010-08-05 12:06:37 +02:00
|
|
|
SIGNAL(modelsCreated()), this, SLOT(handleDeploySpecsChanged()));
|
2010-07-30 12:14:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MaemoRunConfigurationWidget::addDebuggingWidgets(QVBoxLayout *mainLayout)
|
|
|
|
|
{
|
|
|
|
|
m_debugDetailsContainer = new Utils::DetailsWidget(this);
|
|
|
|
|
QWidget *debugWidget = new QWidget;
|
|
|
|
|
m_debugDetailsContainer->setWidget(debugWidget);
|
|
|
|
|
mainLayout->addWidget(m_debugDetailsContainer);
|
|
|
|
|
QFormLayout *debugLayout = new QFormLayout(debugWidget);
|
|
|
|
|
QHBoxLayout *debugRadioButtonsLayout = new QHBoxLayout;
|
|
|
|
|
debugLayout->addRow(debugRadioButtonsLayout);
|
|
|
|
|
QRadioButton *gdbButton = new QRadioButton(tr("Use remote gdb"));
|
|
|
|
|
QRadioButton *gdbServerButton = new QRadioButton(tr("Use remote gdbserver"));
|
|
|
|
|
debugRadioButtonsLayout->addWidget(gdbButton);
|
|
|
|
|
debugRadioButtonsLayout->addWidget(gdbServerButton);
|
|
|
|
|
debugRadioButtonsLayout->addStretch(1);
|
|
|
|
|
gdbButton->setChecked(m_runConfiguration->useRemoteGdb());
|
|
|
|
|
gdbServerButton->setChecked(!gdbButton->isChecked());
|
|
|
|
|
connect(gdbButton, SIGNAL(toggled(bool)), this,
|
|
|
|
|
SLOT(handleDebuggingTypeChanged(bool)));
|
|
|
|
|
handleDebuggingTypeChanged(gdbButton->isChecked());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MaemoRunConfigurationWidget::addMountWidgets(QVBoxLayout *mainLayout)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
m_mountDetailsContainer = new Utils::DetailsWidget(this);
|
2010-07-29 14:35:08 +02:00
|
|
|
QWidget *mountViewWidget = new QWidget;
|
2010-07-30 12:14:54 +02:00
|
|
|
m_mountDetailsContainer->setWidget(mountViewWidget);
|
|
|
|
|
mainLayout->addWidget(m_mountDetailsContainer);
|
2010-07-29 14:35:08 +02:00
|
|
|
QVBoxLayout *mountViewLayout = new QVBoxLayout(mountViewWidget);
|
2010-08-13 15:25:22 +02:00
|
|
|
m_mountWarningLabel = new QLabel;
|
|
|
|
|
mountViewLayout->addWidget(m_mountWarningLabel);
|
2010-07-26 16:07:28 +02:00
|
|
|
QHBoxLayout *tableLayout = new QHBoxLayout;
|
|
|
|
|
mountViewLayout->addLayout(tableLayout);
|
|
|
|
|
m_mountView = new QTableView;
|
|
|
|
|
m_mountView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
|
|
|
|
|
m_mountView->setSelectionBehavior(QTableView::SelectRows);
|
|
|
|
|
m_mountView->setModel(m_runConfiguration->remoteMounts());
|
|
|
|
|
tableLayout->addWidget(m_mountView);
|
|
|
|
|
QVBoxLayout *mountViewButtonsLayout = new QVBoxLayout;
|
|
|
|
|
tableLayout->addLayout(mountViewButtonsLayout);
|
|
|
|
|
QToolButton *addMountButton = new QToolButton;
|
|
|
|
|
QIcon plusIcon;
|
2010-07-30 22:16:59 +02:00
|
|
|
plusIcon.addFile(QLatin1String(Core::Constants::ICON_PLUS));
|
2010-07-26 16:07:28 +02:00
|
|
|
addMountButton->setIcon(plusIcon);
|
|
|
|
|
mountViewButtonsLayout->addWidget(addMountButton);
|
|
|
|
|
m_removeMountButton = new QToolButton;
|
|
|
|
|
QIcon minusIcon;
|
2010-07-30 22:16:59 +02:00
|
|
|
minusIcon.addFile(QLatin1String(Core::Constants::ICON_MINUS));
|
2010-07-26 16:07:28 +02:00
|
|
|
m_removeMountButton->setIcon(minusIcon);
|
|
|
|
|
mountViewButtonsLayout->addWidget(m_removeMountButton);
|
|
|
|
|
mountViewButtonsLayout->addStretch(1);
|
2010-03-31 18:28:04 +02:00
|
|
|
|
2010-07-30 12:14:54 +02:00
|
|
|
connect(addMountButton, SIGNAL(clicked()), this, SLOT(addMount()));
|
|
|
|
|
connect(m_removeMountButton, SIGNAL(clicked()), this, SLOT(removeMount()));
|
|
|
|
|
connect(m_mountView, SIGNAL(doubleClicked(QModelIndex)), this,
|
|
|
|
|
SLOT(changeLocalMountDir(QModelIndex)));
|
|
|
|
|
connect(m_mountView->selectionModel(),
|
|
|
|
|
SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this,
|
|
|
|
|
SLOT(enableOrDisableRemoveMountSpecButton()));
|
|
|
|
|
connect(m_runConfiguration->remoteMounts(),
|
|
|
|
|
SIGNAL(rowsInserted(QModelIndex, int, int)), this,
|
|
|
|
|
SLOT(handleRemoteMountsChanged()));
|
|
|
|
|
connect(m_runConfiguration->remoteMounts(),
|
|
|
|
|
SIGNAL(rowsRemoved(QModelIndex, int, int)), this,
|
|
|
|
|
SLOT(handleRemoteMountsChanged()));
|
|
|
|
|
connect(m_runConfiguration->remoteMounts(),
|
|
|
|
|
SIGNAL(dataChanged(QModelIndex, QModelIndex)), this,
|
|
|
|
|
SLOT(handleRemoteMountsChanged()));
|
|
|
|
|
connect(m_runConfiguration->remoteMounts(), SIGNAL(modelReset()), this,
|
|
|
|
|
SLOT(handleRemoteMountsChanged()));
|
|
|
|
|
enableOrDisableRemoveMountSpecButton();
|
|
|
|
|
handleRemoteMountsChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MaemoRunConfigurationWidget::addEnvironmentWidgets(QVBoxLayout *mainLayout)
|
|
|
|
|
{
|
2010-07-27 17:57:16 +02:00
|
|
|
QWidget *baseEnvironmentWidget = new QWidget;
|
|
|
|
|
QHBoxLayout *baseEnvironmentLayout = new QHBoxLayout(baseEnvironmentWidget);
|
|
|
|
|
baseEnvironmentLayout->setMargin(0);
|
2010-07-30 12:14:54 +02:00
|
|
|
QLabel *label = new QLabel(tr("Base environment for this run configuration:"), this);
|
2010-07-27 17:57:16 +02:00
|
|
|
baseEnvironmentLayout->addWidget(label);
|
2010-07-28 14:27:08 +02:00
|
|
|
m_baseEnvironmentComboBox = new QComboBox(this);
|
2010-07-27 17:57:16 +02:00
|
|
|
m_baseEnvironmentComboBox->addItems(QStringList() << tr("Clean Environment")
|
|
|
|
|
<< tr("System Environment"));
|
2010-07-28 14:27:08 +02:00
|
|
|
m_baseEnvironmentComboBox->setCurrentIndex(m_runConfiguration->baseEnvironmentBase());
|
2010-07-27 17:57:16 +02:00
|
|
|
baseEnvironmentLayout->addWidget(m_baseEnvironmentComboBox);
|
2010-07-28 14:27:08 +02:00
|
|
|
|
2010-07-27 17:57:16 +02:00
|
|
|
m_fetchEnv = new QPushButton(tr("Fetch Device Environment"));
|
|
|
|
|
baseEnvironmentLayout->addWidget(m_fetchEnv);
|
2010-07-28 14:27:08 +02:00
|
|
|
baseEnvironmentLayout->addStretch(10);
|
2010-07-27 17:57:16 +02:00
|
|
|
|
|
|
|
|
m_environmentWidget = new ProjectExplorer::EnvironmentWidget(this, baseEnvironmentWidget);
|
|
|
|
|
m_environmentWidget->setBaseEnvironment(m_deviceEnvReader->deviceEnvironment());
|
2010-07-28 14:27:08 +02:00
|
|
|
m_environmentWidget->setBaseEnvironmentText(m_runConfiguration->baseEnvironmentText());
|
|
|
|
|
m_environmentWidget->setUserChanges(m_runConfiguration->userEnvironmentChanges());
|
2010-07-27 17:57:16 +02:00
|
|
|
mainLayout->addWidget(m_environmentWidget);
|
|
|
|
|
|
2010-07-28 14:27:08 +02:00
|
|
|
connect(m_environmentWidget, SIGNAL(userChangesChanged()), this,
|
|
|
|
|
SLOT(userChangesEdited()));
|
|
|
|
|
connect(m_baseEnvironmentComboBox, SIGNAL(currentIndexChanged(int)),
|
|
|
|
|
this, SLOT(baseEnvironmentSelected(int)));
|
|
|
|
|
connect(m_runConfiguration, SIGNAL(baseEnvironmentChanged()),
|
|
|
|
|
this, SLOT(baseEnvironmentChanged()));
|
|
|
|
|
connect(m_runConfiguration, SIGNAL(systemEnvironmentChanged()),
|
|
|
|
|
this, SLOT(systemEnvironmentChanged()));
|
|
|
|
|
connect(m_runConfiguration,
|
|
|
|
|
SIGNAL(userEnvironmentChangesChanged(QList<ProjectExplorer::EnvironmentItem>)),
|
|
|
|
|
this, SLOT(userEnvironmentChangesChanged(QList<ProjectExplorer::EnvironmentItem>)));
|
|
|
|
|
connect(m_fetchEnv, SIGNAL(pressed()), this, SLOT(fetchEnvironment()));
|
|
|
|
|
connect(m_deviceEnvReader, SIGNAL(finished()), this, SLOT(fetchEnvironmentFinished()));
|
2010-01-07 11:21:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MaemoRunConfigurationWidget::argumentsEdited(const QString &text)
|
|
|
|
|
{
|
|
|
|
|
m_runConfiguration->setArguments(text.split(' ', QString::SkipEmptyParts));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MaemoRunConfigurationWidget::updateTargetInformation()
|
|
|
|
|
{
|
2010-08-04 16:38:37 +02:00
|
|
|
m_localExecutableLabel->setText(m_runConfiguration->localExecutableFilePath());
|
2010-08-05 12:06:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MaemoRunConfigurationWidget::handleDeploySpecsChanged()
|
|
|
|
|
{
|
2010-08-04 16:38:37 +02:00
|
|
|
m_remoteExecutableLabel->setText(m_runConfiguration->remoteExecutableFilePath());
|
2010-01-07 11:21:11 +01:00
|
|
|
}
|
|
|
|
|
|
2010-08-23 17:49:07 +02:00
|
|
|
void MaemoRunConfigurationWidget::handleBuildConfigChanged()
|
|
|
|
|
{
|
|
|
|
|
if (m_lastActiveBuildConfig)
|
|
|
|
|
disconnect(m_lastActiveBuildConfig, 0, this, 0);
|
|
|
|
|
m_lastActiveBuildConfig = m_runConfiguration->activeQt4BuildConfiguration();
|
|
|
|
|
if (m_lastActiveBuildConfig) {
|
|
|
|
|
connect(m_lastActiveBuildConfig, SIGNAL(qtVersionChanged()), this,
|
|
|
|
|
SLOT(handleToolchainChanged()));
|
|
|
|
|
}
|
|
|
|
|
handleToolchainChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MaemoRunConfigurationWidget::handleToolchainChanged()
|
|
|
|
|
{
|
|
|
|
|
const bool remoteMountsAvailable
|
|
|
|
|
= m_runConfiguration->toolchain()->allowsRemoteMounts();
|
|
|
|
|
m_debugDetailsContainer->setVisible(remoteMountsAvailable);
|
|
|
|
|
m_mountDetailsContainer->setVisible(remoteMountsAvailable);
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-31 18:28:04 +02:00
|
|
|
void MaemoRunConfigurationWidget::showSettingsDialog(const QString &link)
|
2010-01-07 11:21:11 +01:00
|
|
|
{
|
2010-04-09 16:52:15 +02:00
|
|
|
if (link == QLatin1String("deviceconfig")) {
|
2010-03-31 18:28:04 +02:00
|
|
|
MaemoSettingsPage *page = MaemoManager::instance().settingsPage();
|
|
|
|
|
Core::ICore::instance()->showOptionsDialog(page->category(), page->id());
|
2010-04-09 16:52:15 +02:00
|
|
|
} else if (link == QLatin1String("debugger")) {
|
|
|
|
|
Core::ICore::instance()->showOptionsDialog(QLatin1String("O.Debugger"),
|
|
|
|
|
QLatin1String("M.Gdb"));
|
2010-03-31 18:28:04 +02:00
|
|
|
}
|
2010-01-07 11:21:11 +01:00
|
|
|
}
|
|
|
|
|
|
2010-07-16 17:09:05 +02:00
|
|
|
void MaemoRunConfigurationWidget::handleCurrentDeviceConfigChanged()
|
|
|
|
|
{
|
2010-08-17 08:46:01 +02:00
|
|
|
m_devConfLabel->setText(m_runConfiguration->deviceConfig().name);
|
2010-08-13 15:25:22 +02:00
|
|
|
updateMountWarning();
|
2010-07-16 17:09:05 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-30 12:14:54 +02:00
|
|
|
void MaemoRunConfigurationWidget::enableOrDisableRemoveMountSpecButton()
|
2010-07-26 16:07:28 +02:00
|
|
|
{
|
|
|
|
|
const QModelIndexList selectedRows
|
|
|
|
|
= m_mountView->selectionModel()->selectedRows();
|
|
|
|
|
m_removeMountButton->setEnabled(!selectedRows.isEmpty());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MaemoRunConfigurationWidget::addMount()
|
|
|
|
|
{
|
|
|
|
|
const QString localDir = QFileDialog::getExistingDirectory(this,
|
|
|
|
|
tr("Choose directory to mount"));
|
|
|
|
|
if (!localDir.isEmpty()) {
|
|
|
|
|
MaemoRemoteMountsModel * const mountsModel
|
|
|
|
|
= m_runConfiguration->remoteMounts();
|
|
|
|
|
mountsModel->addMountSpecification(localDir);
|
|
|
|
|
m_mountView->edit(mountsModel->index(mountsModel->mountSpecificationCount() - 1,
|
|
|
|
|
mountsModel->RemoteMountPointRow));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MaemoRunConfigurationWidget::removeMount()
|
|
|
|
|
{
|
|
|
|
|
const QModelIndexList selectedRows
|
|
|
|
|
= m_mountView->selectionModel()->selectedRows();
|
|
|
|
|
if (!selectedRows.isEmpty()) {
|
|
|
|
|
m_runConfiguration->remoteMounts()
|
|
|
|
|
->removeMountSpecificationAt(selectedRows.first().row());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MaemoRunConfigurationWidget::changeLocalMountDir(const QModelIndex &index)
|
|
|
|
|
{
|
|
|
|
|
if (index.column() == MaemoRemoteMountsModel::LocalDirRow) {
|
|
|
|
|
MaemoRemoteMountsModel * const mountsModel
|
|
|
|
|
= m_runConfiguration->remoteMounts();
|
|
|
|
|
const QString oldDir
|
|
|
|
|
= mountsModel->mountSpecificationAt(index.row()).localDir;
|
|
|
|
|
const QString localDir = QFileDialog::getExistingDirectory(this,
|
|
|
|
|
tr("Choose directory to mount"), oldDir);
|
|
|
|
|
if (!localDir.isEmpty())
|
|
|
|
|
mountsModel->setLocalDir(index.row(), localDir);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-30 12:14:54 +02:00
|
|
|
void MaemoRunConfigurationWidget::handleDebuggingTypeChanged(bool useGdb)
|
|
|
|
|
{
|
|
|
|
|
m_runConfiguration->setUseRemoteGdb(useGdb);
|
|
|
|
|
const QString detailsText = useGdb ? tr("Use gdb") : tr("Use gdbserver");
|
|
|
|
|
m_debugDetailsContainer->setSummaryText(tr("<b>Debugging details:</b> ")
|
|
|
|
|
+ detailsText);
|
2010-07-26 16:07:28 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-27 17:57:16 +02:00
|
|
|
void MaemoRunConfigurationWidget::fetchEnvironment()
|
|
|
|
|
{
|
|
|
|
|
m_deviceEnvReader->start();
|
|
|
|
|
m_fetchEnv->setEnabled(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MaemoRunConfigurationWidget::fetchEnvironmentFinished()
|
|
|
|
|
{
|
|
|
|
|
m_fetchEnv->setEnabled(true);
|
2010-07-28 14:27:08 +02:00
|
|
|
m_runConfiguration->setSystemEnvironment(m_deviceEnvReader->deviceEnvironment());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MaemoRunConfigurationWidget::userChangesEdited()
|
|
|
|
|
{
|
|
|
|
|
m_ignoreChange = true;
|
|
|
|
|
m_runConfiguration->setUserEnvironmentChanges(m_environmentWidget->userChanges());
|
|
|
|
|
m_ignoreChange = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MaemoRunConfigurationWidget::baseEnvironmentSelected(int index)
|
|
|
|
|
{
|
|
|
|
|
m_ignoreChange = true;
|
|
|
|
|
m_runConfiguration->setBaseEnvironmentBase(MaemoRunConfiguration::BaseEnvironmentBase(index));
|
|
|
|
|
|
|
|
|
|
m_environmentWidget->setBaseEnvironment(m_runConfiguration->baseEnvironment());
|
|
|
|
|
m_environmentWidget->setBaseEnvironmentText(m_runConfiguration->baseEnvironmentText());
|
|
|
|
|
m_ignoreChange = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MaemoRunConfigurationWidget::baseEnvironmentChanged()
|
|
|
|
|
{
|
|
|
|
|
if (m_ignoreChange)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
m_baseEnvironmentComboBox->setCurrentIndex(m_runConfiguration->baseEnvironmentBase());
|
|
|
|
|
m_environmentWidget->setBaseEnvironment(m_runConfiguration->baseEnvironment());
|
|
|
|
|
m_environmentWidget->setBaseEnvironmentText(m_runConfiguration->baseEnvironmentText());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MaemoRunConfigurationWidget::systemEnvironmentChanged()
|
|
|
|
|
{
|
|
|
|
|
m_environmentWidget->setBaseEnvironment(m_runConfiguration->systemEnvironment());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MaemoRunConfigurationWidget::userEnvironmentChangesChanged(const QList<ProjectExplorer::EnvironmentItem> &userChanges)
|
|
|
|
|
{
|
|
|
|
|
if (m_ignoreChange)
|
|
|
|
|
return;
|
|
|
|
|
m_environmentWidget->setUserChanges(userChanges);
|
2010-07-27 17:57:16 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-29 14:35:08 +02:00
|
|
|
void MaemoRunConfigurationWidget::handleRemoteMountsChanged()
|
|
|
|
|
{
|
|
|
|
|
const int mountCount
|
|
|
|
|
= m_runConfiguration->remoteMounts()->validMountSpecificationCount();
|
|
|
|
|
QString text;
|
|
|
|
|
switch (mountCount) {
|
|
|
|
|
case 0:
|
2010-08-26 10:23:03 +02:00
|
|
|
text = tr("No local directories to be mounted on the device.");
|
2010-07-29 14:35:08 +02:00
|
|
|
break;
|
|
|
|
|
case 1:
|
2010-08-26 10:23:03 +02:00
|
|
|
text = tr("One local directory to be mounted on the device.");
|
2010-07-29 14:35:08 +02:00
|
|
|
break;
|
|
|
|
|
default:
|
2010-08-26 10:23:03 +02:00
|
|
|
text = tr("%1 local directories to be mounted on the device.")
|
2010-07-29 14:35:08 +02:00
|
|
|
.arg(mountCount);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2010-07-30 12:14:54 +02:00
|
|
|
m_mountDetailsContainer->setSummaryText(QLatin1String("<b>") + text
|
2010-07-29 14:35:08 +02:00
|
|
|
+ QLatin1String("</b>"));
|
2010-08-13 15:25:22 +02:00
|
|
|
updateMountWarning();
|
|
|
|
|
}
|
|
|
|
|
|
2010-09-08 16:51:53 +02:00
|
|
|
void MaemoRunConfigurationWidget::handleQmlDebuggingChanged(bool debugQml)
|
|
|
|
|
{
|
|
|
|
|
m_runConfiguration->setUseQmlDebugger(debugQml);
|
|
|
|
|
updateMountWarning();
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-13 15:25:22 +02:00
|
|
|
void MaemoRunConfigurationWidget::updateMountWarning()
|
|
|
|
|
{
|
|
|
|
|
QString mountWarning;
|
|
|
|
|
const MaemoPortList &portList = m_runConfiguration->freePorts();
|
|
|
|
|
if (portList.hasMore()) {
|
|
|
|
|
const int availablePortCount = portList.count();
|
|
|
|
|
const int mountDirCount
|
|
|
|
|
= m_runConfiguration->remoteMounts()->validMountSpecificationCount();
|
|
|
|
|
if (mountDirCount > availablePortCount) {
|
|
|
|
|
mountWarning = tr("WARNING: You want to mount %1 directories, but "
|
2010-09-10 10:51:43 +02:00
|
|
|
"your device has only %n free ports.<br>You will not be able "
|
|
|
|
|
"to run this configuration.", 0, availablePortCount)
|
|
|
|
|
.arg(mountDirCount);
|
2010-09-08 16:51:53 +02:00
|
|
|
} else if (mountDirCount > 0) {
|
|
|
|
|
const int portsLeftByDebuggers
|
|
|
|
|
= availablePortCount - 1 - m_runConfiguration->useQmlDebugger();
|
|
|
|
|
if (mountDirCount > portsLeftByDebuggers) {
|
|
|
|
|
mountWarning = tr("WARNING: You want to mount %1 directories, "
|
2010-09-10 10:51:43 +02:00
|
|
|
"but only %n ports on the device will be available "
|
2010-09-08 16:51:53 +02:00
|
|
|
"in debug mode. <br>You will not be able to debug your "
|
2010-09-10 10:51:43 +02:00
|
|
|
"application with this configuration.", 0, portsLeftByDebuggers).
|
|
|
|
|
arg(mountDirCount);
|
2010-09-08 16:51:53 +02:00
|
|
|
}
|
2010-08-13 15:25:22 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (mountWarning.isEmpty()) {
|
|
|
|
|
m_mountWarningLabel->hide();
|
|
|
|
|
} else {
|
|
|
|
|
m_mountWarningLabel->setText(QLatin1String("<font color=\"red\">")
|
|
|
|
|
+ mountWarning + QLatin1String("</font>"));
|
|
|
|
|
m_mountWarningLabel->show();
|
|
|
|
|
m_mountDetailsContainer->setState(Utils::DetailsWidget::Expanded);
|
|
|
|
|
}
|
|
|
|
|
m_runConfiguration->updateFactoryState();
|
2010-07-29 14:35:08 +02:00
|
|
|
}
|
|
|
|
|
|
2010-01-07 11:21:11 +01:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Qt4ProjectManager
|