forked from qt-creator/qt-creator
ios: fix deploystep displayName updating
still uses the default deploystepconfiguration, which gives some artifacts (to be fixed later) Change-Id: I3f4f8a71fbe4e18fc171aee571da72da1c9735db Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -40,6 +40,9 @@
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/taskhub.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
|
||||
#include <qmakeprojectmanager/qmakeproject.h>
|
||||
#include <qmakeprojectmanager/qmakenodes.h>
|
||||
@@ -82,14 +85,26 @@ void IosDeployStep::ctor()
|
||||
{
|
||||
m_toolHandler = 0;
|
||||
m_transferStatus = NoTransfer;
|
||||
m_device = ProjectExplorer::DeviceKitInformation::device(target()->kit());
|
||||
const QString devName = m_device.isNull() ? IosDevice::name() : m_device->displayName();
|
||||
cleanup();
|
||||
updateDisplayNames();
|
||||
connect(DeviceManager::instance(), SIGNAL(updated()),
|
||||
SLOT(updateDisplayNames()));
|
||||
connect(target(), SIGNAL(kitChanged()),
|
||||
SLOT(updateDisplayNames()));
|
||||
}
|
||||
|
||||
void IosDeployStep::updateDisplayNames()
|
||||
{
|
||||
ProjectExplorer::IDevice::ConstPtr dev =
|
||||
ProjectExplorer::DeviceKitInformation::device(target()->kit());
|
||||
const QString devName = dev.isNull() ? IosDevice::name() : dev->displayName();
|
||||
setDefaultDisplayName(tr("Deploy to %1").arg(devName));
|
||||
setDisplayName(tr("Deploy to %1").arg(devName));
|
||||
}
|
||||
|
||||
bool IosDeployStep::init()
|
||||
{
|
||||
QTC_CHECK(m_transferStatus == NoTransfer);
|
||||
QTC_ASSERT(m_transferStatus == NoTransfer, return false);
|
||||
m_device = ProjectExplorer::DeviceKitInformation::device(target()->kit());
|
||||
IosRunConfiguration * runConfig = qobject_cast<IosRunConfiguration *>(
|
||||
this->target()->activeRunConfiguration());
|
||||
|
||||
@@ -73,9 +73,6 @@ public:
|
||||
|
||||
void run(QFutureInterface<bool> &fi) QTC_OVERRIDE;
|
||||
void cleanup();
|
||||
ProjectExplorer::IDevice::ConstPtr device() const;
|
||||
IosDevice::ConstPtr iosdevice() const;
|
||||
IosSimulator::ConstPtr iossimulator() const;
|
||||
void cancel();
|
||||
signals:
|
||||
//void done();
|
||||
@@ -89,7 +86,7 @@ private slots:
|
||||
Ios::IosToolHandler::OpStatus status);
|
||||
void handleFinished(Ios::IosToolHandler *handler);
|
||||
void handleErrorMsg(Ios::IosToolHandler *handler, const QString &msg);
|
||||
|
||||
void updateDisplayNames();
|
||||
private:
|
||||
IosDeployStep(ProjectExplorer::BuildStepList *bc,
|
||||
IosDeployStep *other);
|
||||
@@ -97,6 +94,9 @@ private:
|
||||
ProjectExplorer::BuildStepConfigWidget *createConfigWidget() QTC_OVERRIDE;
|
||||
bool immutable() const QTC_OVERRIDE { return true; }
|
||||
bool runInGuiThread() const QTC_OVERRIDE { return true; }
|
||||
ProjectExplorer::IDevice::ConstPtr device() const;
|
||||
IosDevice::ConstPtr iosdevice() const;
|
||||
IosSimulator::ConstPtr iossimulator() const;
|
||||
|
||||
void ctor();
|
||||
QString deviceId() const;
|
||||
|
||||
@@ -46,6 +46,7 @@ IosDeployStepWidget::IosDeployStepWidget(IosDeployStep *step) :
|
||||
m_step(step)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connect(m_step, SIGNAL(displayNameChanged()), SIGNAL(updateSummary()));
|
||||
}
|
||||
|
||||
IosDeployStepWidget::~IosDeployStepWidget()
|
||||
@@ -55,8 +56,7 @@ IosDeployStepWidget::~IosDeployStepWidget()
|
||||
|
||||
QString IosDeployStepWidget::displayName() const
|
||||
{
|
||||
const QString deviceName = m_step->device().isNull() ? IosDevice::name() : m_step->device()->displayName();
|
||||
return tr("<b>Deploy to %1</b>").arg(deviceName);
|
||||
return QString::fromLatin1("<b>%1</b>").arg(m_step->displayName());
|
||||
}
|
||||
|
||||
QString IosDeployStepWidget::summaryText() const
|
||||
|
||||
Reference in New Issue
Block a user