2009-10-21 16:48:46 +02:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2010-03-05 11:25:49 +01:00
|
|
|
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
2009-10-21 16:48:46 +02:00
|
|
|
**
|
|
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
|
|
|
**
|
|
|
|
|
** Commercial Usage
|
|
|
|
|
**
|
|
|
|
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
|
|
|
** accordance with the Qt Commercial License Agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Nokia.
|
|
|
|
|
**
|
|
|
|
|
** 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.
|
|
|
|
|
**
|
|
|
|
|
** If you are unsure which license is appropriate for your use, please
|
|
|
|
|
** contact the sales department at http://qt.nokia.com/contact.
|
|
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "s60devicerunconfigurationwidget.h"
|
|
|
|
|
#include "s60devicerunconfiguration.h"
|
2009-10-23 18:00:20 +02:00
|
|
|
#include "s60runconfigbluetoothstarter.h"
|
|
|
|
|
#include "bluetoothlistener_gui.h"
|
2009-10-21 16:48:46 +02:00
|
|
|
#include "s60manager.h"
|
|
|
|
|
#include "launcher.h"
|
2009-10-23 18:00:20 +02:00
|
|
|
#include "bluetoothlistener.h"
|
2010-02-05 17:34:02 +01:00
|
|
|
#include "symbiandevicemanager.h"
|
2009-10-21 16:48:46 +02:00
|
|
|
|
|
|
|
|
#include <utils/detailswidget.h>
|
|
|
|
|
#include <utils/qtcassert.h>
|
|
|
|
|
#include <utils/pathchooser.h>
|
|
|
|
|
|
|
|
|
|
#include <QtCore/QTimer>
|
2009-10-26 18:34:57 +01:00
|
|
|
#include <QtCore/QDir>
|
2009-10-21 16:48:46 +02:00
|
|
|
#include <QtGui/QRadioButton>
|
|
|
|
|
#include <QtGui/QLabel>
|
|
|
|
|
#include <QtGui/QLineEdit>
|
|
|
|
|
#include <QtGui/QComboBox>
|
|
|
|
|
#include <QtGui/QVBoxLayout>
|
|
|
|
|
#include <QtGui/QHBoxLayout>
|
|
|
|
|
#include <QtGui/QFormLayout>
|
|
|
|
|
#include <QtGui/QToolButton>
|
|
|
|
|
#include <QtGui/QStyle>
|
|
|
|
|
#include <QtGui/QApplication>
|
|
|
|
|
#include <QtGui/QSpacerItem>
|
2009-10-29 12:48:12 +01:00
|
|
|
#include <QtGui/QMainWindow>
|
|
|
|
|
#include <QtGui/QMessageBox>
|
2010-07-20 13:37:15 +02:00
|
|
|
#include <QtGui/QCheckBox>
|
2009-10-21 16:48:46 +02:00
|
|
|
|
2010-02-05 17:34:02 +01:00
|
|
|
Q_DECLARE_METATYPE(SymbianUtils::SymbianDevice)
|
2009-10-22 16:42:25 +02:00
|
|
|
|
2010-03-30 13:43:38 +02:00
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
|
enum { wantUpdateSerialDevicesButton = 0 };
|
|
|
|
|
#else
|
|
|
|
|
enum { wantUpdateSerialDevicesButton = 1 };
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-10-21 16:48:46 +02:00
|
|
|
namespace Qt4ProjectManager {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2010-07-20 13:37:15 +02:00
|
|
|
const char STARTING_DRIVE_LETTER = 'C';
|
|
|
|
|
const char LAST_DRIVE_LETTER = 'Z';
|
|
|
|
|
|
2009-10-21 16:48:46 +02:00
|
|
|
S60DeviceRunConfigurationWidget::S60DeviceRunConfigurationWidget(
|
|
|
|
|
S60DeviceRunConfiguration *runConfiguration,
|
|
|
|
|
QWidget *parent)
|
|
|
|
|
: QWidget(parent),
|
|
|
|
|
m_runConfiguration(runConfiguration),
|
|
|
|
|
m_detailsWidget(new Utils::DetailsWidget),
|
|
|
|
|
m_serialPortsCombo(new QComboBox),
|
2010-01-07 18:17:24 +01:00
|
|
|
m_nameLineEdit(new QLineEdit(m_runConfiguration->displayName())),
|
2010-01-21 12:35:09 +01:00
|
|
|
m_argumentsLineEdit(new QLineEdit(m_runConfiguration->commandLineArguments().join(QString(QLatin1Char(' '))))),
|
2010-02-18 14:47:00 +01:00
|
|
|
m_sisFileLabel(new QLabel),
|
2009-10-21 16:48:46 +02:00
|
|
|
m_deviceInfoButton(new QToolButton),
|
|
|
|
|
m_deviceInfoDescriptionLabel(new QLabel(tr("Device:"))),
|
|
|
|
|
m_deviceInfoLabel(new QLabel),
|
2010-07-20 13:37:15 +02:00
|
|
|
m_infoTimeOutTimer(0),
|
|
|
|
|
m_installationDriveCombo(new QComboBox),
|
|
|
|
|
m_silentInstallCheckBox(new QCheckBox(tr("Silent installation")))
|
2009-10-21 16:48:46 +02:00
|
|
|
{
|
2010-02-01 17:22:05 +01:00
|
|
|
m_detailsWidget->setState(Utils::DetailsWidget::NoSummary);
|
2009-10-26 18:34:57 +01:00
|
|
|
updateTargetInformation();
|
2009-10-21 16:48:46 +02:00
|
|
|
QVBoxLayout *mainBoxLayout = new QVBoxLayout();
|
|
|
|
|
mainBoxLayout->setMargin(0);
|
|
|
|
|
setLayout(mainBoxLayout);
|
|
|
|
|
mainBoxLayout->addWidget(m_detailsWidget);
|
|
|
|
|
QWidget *detailsContainer = new QWidget;
|
|
|
|
|
m_detailsWidget->setWidget(detailsContainer);
|
|
|
|
|
|
|
|
|
|
QVBoxLayout *detailsBoxLayout = new QVBoxLayout();
|
|
|
|
|
detailsBoxLayout->setMargin(0);
|
|
|
|
|
detailsContainer->setLayout(detailsBoxLayout);
|
|
|
|
|
|
|
|
|
|
QFormLayout *formLayout = new QFormLayout();
|
|
|
|
|
formLayout->setMargin(0);
|
|
|
|
|
detailsBoxLayout->addLayout(formLayout);
|
|
|
|
|
// Name control
|
|
|
|
|
QLabel *nameLabel = new QLabel(tr("Name:"));
|
|
|
|
|
nameLabel->setBuddy(m_nameLineEdit);
|
|
|
|
|
formLayout->addRow(nameLabel, m_nameLineEdit);
|
2010-01-21 12:35:09 +01:00
|
|
|
formLayout->addRow(tr("Arguments:"), m_argumentsLineEdit);
|
2010-05-14 15:45:43 +02:00
|
|
|
formLayout->addRow(tr("Installation file:"), m_sisFileLabel);
|
2009-10-21 16:48:46 +02:00
|
|
|
|
2010-07-20 13:37:15 +02:00
|
|
|
// Installation Drive control
|
|
|
|
|
updateInstallationDrives();
|
|
|
|
|
m_installationDriveCombo->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
|
|
|
|
connect(m_installationDriveCombo, SIGNAL(activated(int)), this, SLOT(setInstallationDrive(int)));
|
|
|
|
|
QHBoxLayout *installationDriveHBoxLayout = new QHBoxLayout;
|
|
|
|
|
installationDriveHBoxLayout->addWidget(m_installationDriveCombo);
|
|
|
|
|
installationDriveHBoxLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
|
|
|
|
|
formLayout->addRow(tr("Installation drive:"), installationDriveHBoxLayout);
|
|
|
|
|
|
|
|
|
|
// Non-silent installs are a fallback if one wants to override missing dependencies.
|
|
|
|
|
m_silentInstallCheckBox->setChecked(m_runConfiguration->silentInstall());
|
|
|
|
|
m_silentInstallCheckBox->setToolTip(tr("Silent installation is an installation mode "
|
|
|
|
|
"that does not require user's intervention. "
|
|
|
|
|
"In case it fails the non silent installation is launched."));
|
|
|
|
|
connect(m_silentInstallCheckBox, SIGNAL(stateChanged(int)), this, SLOT(silentInstallChanged(int)));
|
|
|
|
|
formLayout->addRow(m_silentInstallCheckBox);
|
|
|
|
|
|
2010-01-29 21:33:57 +01:00
|
|
|
updateSerialDevices();
|
2010-02-05 17:34:02 +01:00
|
|
|
connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(updated()),
|
2009-10-21 16:48:46 +02:00
|
|
|
this, SLOT(updateSerialDevices()));
|
|
|
|
|
// Serial devices control
|
2010-06-07 17:23:50 +02:00
|
|
|
m_serialPortsCombo->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
2009-10-21 16:48:46 +02:00
|
|
|
connect(m_serialPortsCombo, SIGNAL(activated(int)), this, SLOT(setSerialPort(int)));
|
|
|
|
|
QHBoxLayout *serialPortHBoxLayout = new QHBoxLayout;
|
|
|
|
|
serialPortHBoxLayout->addWidget(m_serialPortsCombo);
|
2009-10-26 18:34:57 +01:00
|
|
|
serialPortHBoxLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
|
2010-03-30 13:43:38 +02:00
|
|
|
// Update device list: on Linux only.
|
|
|
|
|
if (wantUpdateSerialDevicesButton) {
|
|
|
|
|
QToolButton *updateSerialDevicesButton(new QToolButton);
|
|
|
|
|
updateSerialDevicesButton->setIcon(qApp->style()->standardIcon(QStyle::SP_BrowserReload));
|
|
|
|
|
connect(updateSerialDevicesButton, SIGNAL(clicked()),
|
|
|
|
|
SymbianUtils::SymbianDeviceManager::instance(), SLOT(update()));
|
|
|
|
|
serialPortHBoxLayout->addWidget(updateSerialDevicesButton);
|
|
|
|
|
}
|
2009-10-21 16:48:46 +02:00
|
|
|
|
2010-05-14 15:45:43 +02:00
|
|
|
formLayout->addRow(tr("Device on serial port:"), serialPortHBoxLayout);
|
2009-10-21 16:48:46 +02:00
|
|
|
|
|
|
|
|
// Device Info with button. Widgets are enabled in above call to updateSerialDevices()
|
|
|
|
|
QHBoxLayout *infoHBoxLayout = new QHBoxLayout;
|
|
|
|
|
m_deviceInfoLabel->setWordWrap(true);
|
2009-10-26 09:12:00 +01:00
|
|
|
m_deviceInfoLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
|
2009-10-21 16:48:46 +02:00
|
|
|
infoHBoxLayout->addWidget(m_deviceInfoLabel);
|
|
|
|
|
infoHBoxLayout->addWidget(m_deviceInfoButton);
|
|
|
|
|
m_deviceInfoButton->setIcon(qApp->style()->standardIcon(QStyle::SP_MessageBoxInformation));
|
|
|
|
|
m_deviceInfoButton->setToolTip(tr("Queries the device for information"));
|
|
|
|
|
connect(m_deviceInfoButton, SIGNAL(clicked()), this, SLOT(updateDeviceInfo()));
|
|
|
|
|
formLayout->addRow(m_deviceInfoDescriptionLabel, infoHBoxLayout);
|
|
|
|
|
|
|
|
|
|
connect(m_nameLineEdit, SIGNAL(textEdited(QString)),
|
2010-01-07 18:17:24 +01:00
|
|
|
this, SLOT(displayNameEdited(QString)));
|
2010-01-21 12:35:09 +01:00
|
|
|
connect(m_argumentsLineEdit, SIGNAL(textEdited(QString)),
|
|
|
|
|
this, SLOT(argumentsEdited(QString)));
|
2009-10-21 16:48:46 +02:00
|
|
|
connect(m_runConfiguration, SIGNAL(targetInformationChanged()),
|
|
|
|
|
this, SLOT(updateTargetInformation()));
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-20 13:37:15 +02:00
|
|
|
void S60DeviceRunConfigurationWidget::updateInstallationDrives()
|
|
|
|
|
{
|
|
|
|
|
m_installationDriveCombo->clear();
|
|
|
|
|
for (int i = STARTING_DRIVE_LETTER; i <= LAST_DRIVE_LETTER; ++i) {
|
|
|
|
|
m_installationDriveCombo->addItem(QString("%1:").arg((char)i), qVariantFromValue(i));
|
|
|
|
|
}
|
|
|
|
|
int index = (char)QChar::toUpper((uint)m_runConfiguration->installationDrive())-STARTING_DRIVE_LETTER;
|
|
|
|
|
|
|
|
|
|
Q_ASSERT(index>= 0 && index <= LAST_DRIVE_LETTER-STARTING_DRIVE_LETTER);
|
|
|
|
|
|
|
|
|
|
m_installationDriveCombo->setCurrentIndex(index);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void S60DeviceRunConfigurationWidget::silentInstallChanged(int state)
|
|
|
|
|
{
|
|
|
|
|
bool isSilent = state == Qt::Checked;
|
|
|
|
|
m_runConfiguration->setSilentInstall(isSilent);
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-21 16:48:46 +02:00
|
|
|
void S60DeviceRunConfigurationWidget::updateSerialDevices()
|
|
|
|
|
{
|
|
|
|
|
m_serialPortsCombo->clear();
|
|
|
|
|
clearDeviceInfo();
|
|
|
|
|
const QString previousRunConfigurationPortName = m_runConfiguration->serialPortName();
|
2010-02-05 17:34:02 +01:00
|
|
|
const QList<SymbianUtils::SymbianDevice> devices = SymbianUtils::SymbianDeviceManager::instance()->devices();
|
2009-10-21 16:48:46 +02:00
|
|
|
int newIndex = -1;
|
2009-10-22 16:42:25 +02:00
|
|
|
for (int i = 0; i < devices.size(); ++i) {
|
2010-02-05 17:34:02 +01:00
|
|
|
const SymbianUtils::SymbianDevice &device = devices.at(i);
|
2010-02-05 17:21:29 +01:00
|
|
|
m_serialPortsCombo->addItem(device.friendlyName(), qVariantFromValue(device));
|
|
|
|
|
if (device.portName() == previousRunConfigurationPortName)
|
2009-10-21 16:48:46 +02:00
|
|
|
newIndex = i;
|
|
|
|
|
}
|
|
|
|
|
// Set new index: prefer to keep old or set to 0, if available.
|
2009-10-22 16:42:25 +02:00
|
|
|
if (newIndex == -1 && !devices.empty())
|
2009-10-21 16:48:46 +02:00
|
|
|
newIndex = 0;
|
|
|
|
|
m_serialPortsCombo->setCurrentIndex(newIndex);
|
|
|
|
|
if (newIndex == -1) {
|
|
|
|
|
m_deviceInfoButton->setEnabled(false);
|
|
|
|
|
m_runConfiguration->setSerialPortName(QString());
|
|
|
|
|
} else {
|
|
|
|
|
m_deviceInfoButton->setEnabled(true);
|
2010-02-05 17:21:29 +01:00
|
|
|
const QString newPortName = device(newIndex).portName();
|
2009-10-21 16:48:46 +02:00
|
|
|
if (newPortName != previousRunConfigurationPortName)
|
|
|
|
|
m_runConfiguration->setSerialPortName(newPortName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-02-05 17:34:02 +01:00
|
|
|
SymbianUtils::SymbianDevice S60DeviceRunConfigurationWidget::device(int i) const
|
2009-10-21 16:48:46 +02:00
|
|
|
{
|
2009-10-22 16:42:25 +02:00
|
|
|
if (i >= 0) {
|
|
|
|
|
const QVariant data = m_serialPortsCombo->itemData(i);
|
2010-02-05 17:34:02 +01:00
|
|
|
if (qVariantCanConvert<SymbianUtils::SymbianDevice>(data))
|
|
|
|
|
return qVariantValue<SymbianUtils::SymbianDevice>(data);
|
2009-10-22 16:42:25 +02:00
|
|
|
}
|
2010-02-05 17:34:02 +01:00
|
|
|
return SymbianUtils::SymbianDevice();
|
2009-10-21 16:48:46 +02:00
|
|
|
}
|
|
|
|
|
|
2010-02-05 17:34:02 +01:00
|
|
|
SymbianUtils::SymbianDevice S60DeviceRunConfigurationWidget::currentDevice() const
|
2009-10-21 16:48:46 +02:00
|
|
|
{
|
2009-10-22 16:42:25 +02:00
|
|
|
return device(m_serialPortsCombo->currentIndex());
|
2009-10-21 16:48:46 +02:00
|
|
|
}
|
|
|
|
|
|
2010-01-07 18:17:24 +01:00
|
|
|
void S60DeviceRunConfigurationWidget::displayNameEdited(const QString &text)
|
2009-10-21 16:48:46 +02:00
|
|
|
{
|
2010-01-07 18:17:24 +01:00
|
|
|
m_runConfiguration->setDisplayName(text);
|
2009-10-21 16:48:46 +02:00
|
|
|
}
|
|
|
|
|
|
2010-01-21 12:35:09 +01:00
|
|
|
void S60DeviceRunConfigurationWidget::argumentsEdited(const QString &text)
|
|
|
|
|
{
|
|
|
|
|
const QString trimmed = text.trimmed();
|
|
|
|
|
if (trimmed.isEmpty()) {
|
|
|
|
|
m_runConfiguration->setCommandLineArguments(QStringList());
|
|
|
|
|
} else {
|
|
|
|
|
m_runConfiguration->setCommandLineArguments(trimmed.split(QLatin1Char(' '),
|
|
|
|
|
QString::SkipEmptyParts));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-21 16:48:46 +02:00
|
|
|
void S60DeviceRunConfigurationWidget::updateTargetInformation()
|
|
|
|
|
{
|
2010-07-23 16:37:10 +02:00
|
|
|
m_sisFileLabel->setText(QDir::toNativeSeparators(m_runConfiguration->appPackageTemplateFileName()));
|
2009-10-21 16:48:46 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-20 13:37:15 +02:00
|
|
|
void S60DeviceRunConfigurationWidget::setInstallationDrive(int index)
|
|
|
|
|
{
|
|
|
|
|
m_runConfiguration->setInstallationDrive((char)(STARTING_DRIVE_LETTER + index));
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-21 16:48:46 +02:00
|
|
|
void S60DeviceRunConfigurationWidget::setSerialPort(int index)
|
|
|
|
|
{
|
2010-02-05 17:34:02 +01:00
|
|
|
const SymbianUtils::SymbianDevice d = device(index);
|
2010-02-05 17:21:29 +01:00
|
|
|
m_runConfiguration->setSerialPortName(d.portName());
|
2009-10-21 16:48:46 +02:00
|
|
|
m_deviceInfoButton->setEnabled(index >= 0);
|
|
|
|
|
clearDeviceInfo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void S60DeviceRunConfigurationWidget::clearDeviceInfo()
|
|
|
|
|
{
|
|
|
|
|
// Restore text & color
|
|
|
|
|
m_deviceInfoLabel->clear();
|
|
|
|
|
m_deviceInfoLabel->setStyleSheet(QString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void S60DeviceRunConfigurationWidget::setDeviceInfoLabel(const QString &message, bool isError)
|
|
|
|
|
{
|
|
|
|
|
m_deviceInfoLabel->setStyleSheet(isError ?
|
|
|
|
|
QString(QLatin1String("background-color: red;")) :
|
|
|
|
|
QString());
|
|
|
|
|
m_deviceInfoLabel->setText(message);
|
2009-10-23 18:00:20 +02:00
|
|
|
m_deviceInfoLabel->adjustSize();
|
2009-10-21 16:48:46 +02:00
|
|
|
}
|
|
|
|
|
|
2009-10-29 12:48:12 +01:00
|
|
|
void S60DeviceRunConfigurationWidget::slotLauncherStateChanged(int s)
|
2009-10-21 16:48:46 +02:00
|
|
|
{
|
2009-10-29 12:48:12 +01:00
|
|
|
switch (s) {
|
|
|
|
|
case trk::Launcher::WaitingForTrk: {
|
|
|
|
|
// Entered trk wait state..open message box
|
|
|
|
|
QMessageBox *mb = S60DeviceRunControlBase::createTrkWaitingMessageBox(m_infoLauncher->trkServerName(), this);
|
|
|
|
|
connect(m_infoLauncher, SIGNAL(stateChanged(int)), mb, SLOT(close()));
|
|
|
|
|
connect(mb, SIGNAL(finished(int)), this, SLOT(slotWaitingForTrkClosed()));
|
|
|
|
|
mb->open();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case trk::Launcher::DeviceDescriptionReceived: // All ok, done
|
|
|
|
|
setDeviceInfoLabel(m_infoLauncher->deviceDescription());
|
|
|
|
|
m_deviceInfoButton->setEnabled(true);
|
|
|
|
|
m_infoLauncher->deleteLater();
|
|
|
|
|
break;
|
|
|
|
|
}
|
2009-10-21 16:48:46 +02:00
|
|
|
}
|
|
|
|
|
|
2009-10-29 12:48:12 +01:00
|
|
|
void S60DeviceRunConfigurationWidget::slotWaitingForTrkClosed()
|
2009-10-21 16:48:46 +02:00
|
|
|
{
|
2009-10-29 12:48:12 +01:00
|
|
|
if (m_infoLauncher && m_infoLauncher->state() == trk::Launcher::WaitingForTrk) {
|
|
|
|
|
m_infoLauncher->deleteLater();
|
|
|
|
|
clearDeviceInfo();
|
|
|
|
|
m_deviceInfoButton->setEnabled(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void S60DeviceRunConfigurationWidget::updateDeviceInfo()
|
|
|
|
|
{
|
|
|
|
|
QTC_ASSERT(!m_infoLauncher, return)
|
|
|
|
|
setDeviceInfoLabel(tr("Connecting..."));
|
|
|
|
|
// Do a launcher run with the ping protocol. Prompt to connect and
|
|
|
|
|
// go asynchronous afterwards to pop up launch trk box if a timeout occurs.
|
2010-02-11 12:31:59 +01:00
|
|
|
QString message;
|
2010-02-05 17:34:02 +01:00
|
|
|
const SymbianUtils::SymbianDevice commDev = currentDevice();
|
2010-02-11 12:31:59 +01:00
|
|
|
m_infoLauncher = trk::Launcher::acquireFromDeviceManager(commDev.portName(), this, &message);
|
|
|
|
|
if (!m_infoLauncher) {
|
|
|
|
|
setDeviceInfoLabel(message, true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
connect(m_infoLauncher, SIGNAL(stateChanged(int)), this, SLOT(slotLauncherStateChanged(int)));
|
|
|
|
|
|
2010-02-05 17:34:02 +01:00
|
|
|
m_infoLauncher->setSerialFrame(commDev.type() == SymbianUtils::SerialPortCommunication);
|
2010-02-05 17:21:29 +01:00
|
|
|
m_infoLauncher->setTrkServerName(commDev.portName());
|
2009-10-26 15:37:09 +01:00
|
|
|
// Prompt user
|
|
|
|
|
const trk::PromptStartCommunicationResult src =
|
2009-10-29 12:48:12 +01:00
|
|
|
S60RunConfigBluetoothStarter::startCommunication(m_infoLauncher->trkDevice(),
|
2010-02-11 12:31:59 +01:00
|
|
|
this, &message);
|
2009-10-26 15:37:09 +01:00
|
|
|
switch (src) {
|
|
|
|
|
case trk::PromptStartCommunicationConnected:
|
|
|
|
|
break;
|
|
|
|
|
case trk::PromptStartCommunicationCanceled:
|
2009-10-29 12:48:12 +01:00
|
|
|
clearDeviceInfo();
|
|
|
|
|
m_infoLauncher->deleteLater();
|
|
|
|
|
return;
|
2009-10-26 15:37:09 +01:00
|
|
|
case trk::PromptStartCommunicationError:
|
2009-10-29 12:48:12 +01:00
|
|
|
setDeviceInfoLabel(message, true);
|
|
|
|
|
m_infoLauncher->deleteLater();
|
|
|
|
|
return;
|
2009-10-26 15:37:09 +01:00
|
|
|
};
|
2009-10-29 12:48:12 +01:00
|
|
|
if (!m_infoLauncher->startServer(&message)) {
|
|
|
|
|
setDeviceInfoLabel(message, true);
|
2010-01-29 21:33:57 +01:00
|
|
|
m_infoLauncher->deleteLater();
|
2009-10-29 12:48:12 +01:00
|
|
|
return;
|
2009-10-21 16:48:46 +02:00
|
|
|
}
|
2009-10-29 12:48:12 +01:00
|
|
|
// Wait for either timeout or results
|
|
|
|
|
m_deviceInfoButton->setEnabled(false);
|
|
|
|
|
return;
|
2009-10-21 16:48:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Qt4ProjectManager
|