Deploy steps: Introduce SimpleBuildStepConfigWidget.

This simplifies some deploy steps and replaces
RemoteLinuxDeployStepWidget.

Change-Id: I4ad82c498cee0f15e1c93bf915cd48355017eb84
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
Reviewed-by: Paweł Polański <pawel.3.polanski@nokia.com>
This commit is contained in:
Nikolai Kosjar
2012-01-09 16:23:40 +01:00
parent 2d88b3d905
commit f75abb341e
11 changed files with 34 additions and 221 deletions

View File

@@ -147,6 +147,28 @@ signals:
void updateAdditionalSummary(); void updateAdditionalSummary();
}; };
class PROJECTEXPLORER_EXPORT SimpleBuildStepConfigWidget
: public BuildStepConfigWidget
{
Q_OBJECT
public:
SimpleBuildStepConfigWidget(BuildStep *step)
: m_step(step)
{
connect(m_step, SIGNAL(displayNameChanged()), SIGNAL(updateSummary()));
}
~SimpleBuildStepConfigWidget() {}
QString summaryText() const { return QString("<b>%1</b>").arg(displayName()); }
QString displayName() const { return m_step->displayName(); }
bool showWidget() const { return false; }
BuildStep *step() const { return m_step; }
private:
BuildStep *m_step;
};
} // namespace ProjectExplorer } // namespace ProjectExplorer
Q_DECLARE_METATYPE(ProjectExplorer::BuildStep::OutputFormat) Q_DECLARE_METATYPE(ProjectExplorer::BuildStep::OutputFormat)

View File

@@ -135,7 +135,7 @@ S60DeployStep::S60DeployStep(ProjectExplorer::BuildStepList *bc):
void S60DeployStep::ctor() void S60DeployStep::ctor()
{ {
//: Qt4 Deploystep display name //: Qt4 Deploystep display name
setDefaultDisplayName(tr("Deploy")); setDefaultDisplayName(tr("Deploy SIS Package"));
m_timeoutTimer->setSingleShot(true); m_timeoutTimer->setSingleShot(true);
m_timeoutTimer->setInterval(10000); m_timeoutTimer->setInterval(10000);
connect(m_timeoutTimer, SIGNAL(timeout()), this, SLOT(timeout())); connect(m_timeoutTimer, SIGNAL(timeout()), this, SLOT(timeout()));
@@ -657,30 +657,9 @@ void S60DeployStep::timeout()
reportError(tr("A timeout while deploying has occurred. CODA might not be responding. Try reconnecting the device.")); reportError(tr("A timeout while deploying has occurred. CODA might not be responding. Try reconnecting the device."));
} }
// #pragma mark -- S60DeployStepWidget
BuildStepConfigWidget *S60DeployStep::createConfigWidget() BuildStepConfigWidget *S60DeployStep::createConfigWidget()
{ {
return new S60DeployStepWidget(); return new SimpleBuildStepConfigWidget(this);
}
S60DeployStepWidget::S60DeployStepWidget() : ProjectExplorer::BuildStepConfigWidget()
{
}
QString S60DeployStepWidget::summaryText() const
{
return QString("<b>%1</b>").arg(displayName());
}
QString S60DeployStepWidget::displayName() const
{
return tr("Deploy SIS Package");
}
bool S60DeployStepWidget::showWidget() const
{
return false;
} }
// #pragma mark -- S60DeployStepFactory // #pragma mark -- S60DeployStepFactory

View File

@@ -207,17 +207,6 @@ private:
int m_copyProgress; int m_copyProgress;
}; };
class S60DeployStepWidget : public ProjectExplorer::BuildStepConfigWidget
{
Q_OBJECT
public:
S60DeployStepWidget();
QString summaryText() const;
QString displayName() const;
bool showWidget() const;
};
} // Internal } // Internal
} // Qt4ProjectManager } // Qt4ProjectManager

View File

@@ -33,7 +33,6 @@
#include "abstractremotelinuxdeployservice.h" #include "abstractremotelinuxdeployservice.h"
#include "remotelinuxdeployconfiguration.h" #include "remotelinuxdeployconfiguration.h"
#include "remotelinuxdeploystepwidget.h"
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
@@ -115,7 +114,7 @@ void AbstractRemoteLinuxDeployStep::cancel()
BuildStepConfigWidget *AbstractRemoteLinuxDeployStep::createConfigWidget() BuildStepConfigWidget *AbstractRemoteLinuxDeployStep::createConfigWidget()
{ {
return new RemoteLinuxDeployStepWidget(this); return new SimpleBuildStepConfigWidget(this);
} }
RemoteLinuxDeployConfiguration *AbstractRemoteLinuxDeployStep::deployConfiguration() const RemoteLinuxDeployConfiguration *AbstractRemoteLinuxDeployStep::deployConfiguration() const

View File

@@ -35,7 +35,6 @@
#include "deploymentinfo.h" #include "deploymentinfo.h"
#include "genericdirectuploadservice.h" #include "genericdirectuploadservice.h"
#include "remotelinuxdeployconfiguration.h" #include "remotelinuxdeployconfiguration.h"
#include "remotelinuxdeploystepwidget.h"
#include <QtGui/QCheckBox> #include <QtGui/QCheckBox>
#include <QtGui/QVBoxLayout> #include <QtGui/QVBoxLayout>
@@ -78,7 +77,7 @@ private:
myStep()->setIncrementalDeployment(incremental); myStep()->setIncrementalDeployment(incremental);
} }
RemoteLinuxDeployStepWidget m_widget; SimpleBuildStepConfigWidget m_widget;
QCheckBox m_incrementalCheckBox; QCheckBox m_incrementalCheckBox;
}; };

View File

@@ -47,7 +47,6 @@ HEADERS += \
linuxdevicetestdialog.h \ linuxdevicetestdialog.h \
remotelinuxprocesslist.h \ remotelinuxprocesslist.h \
remotelinuxprocessesdialog.h \ remotelinuxprocessesdialog.h \
remotelinuxdeploystepwidget.h \
linuxdeviceconfigurationssettingswidget.h \ linuxdeviceconfigurationssettingswidget.h \
remotelinuxenvironmentreader.h \ remotelinuxenvironmentreader.h \
sshkeydeployer.h \ sshkeydeployer.h \
@@ -103,7 +102,6 @@ SOURCES += \
linuxdevicetestdialog.cpp \ linuxdevicetestdialog.cpp \
remotelinuxprocesslist.cpp \ remotelinuxprocesslist.cpp \
remotelinuxprocessesdialog.cpp \ remotelinuxprocessesdialog.cpp \
remotelinuxdeploystepwidget.cpp \
linuxdeviceconfigurationssettingswidget.cpp \ linuxdeviceconfigurationssettingswidget.cpp \
remotelinuxenvironmentreader.cpp \ remotelinuxenvironmentreader.cpp \
sshkeydeployer.cpp \ sshkeydeployer.cpp \

View File

@@ -31,8 +31,6 @@
**************************************************************************/ **************************************************************************/
#include "remotelinuxcustomcommanddeploymentstep.h" #include "remotelinuxcustomcommanddeploymentstep.h"
#include "remotelinuxdeploystepwidget.h"
#include <QtCore/QString> #include <QtCore/QString>
#include <QtGui/QHBoxLayout> #include <QtGui/QHBoxLayout>
#include <QtGui/QLabel> #include <QtGui/QLabel>
@@ -80,7 +78,7 @@ private:
AbstractRemoteLinuxCustomCommandDeploymentStep * const m_step; AbstractRemoteLinuxCustomCommandDeploymentStep * const m_step;
QLineEdit m_commandLineEdit; QLineEdit m_commandLineEdit;
RemoteLinuxDeployStepWidget m_widget; SimpleBuildStepConfigWidget m_widget;
}; };
} // anonymous namespace } // anonymous namespace

View File

@@ -1,77 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** 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.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#include "remotelinuxdeploystepwidget.h"
#include "abstractremotelinuxdeploystep.h"
#include "deploymentinfo.h"
#include "remotelinuxdeployconfiguration.h"
#include "remotelinuxutils.h"
#include <projectexplorer/target.h>
#include <qt4projectmanager/qt4project.h>
using namespace ProjectExplorer;
using namespace Qt4ProjectManager;
namespace RemoteLinux {
using namespace Internal;
RemoteLinuxDeployStepWidget::RemoteLinuxDeployStepWidget(AbstractRemoteLinuxDeployStep *step)
: m_step(step)
{
BuildStepList * const list = step->deployConfiguration()->stepList();
connect(list, SIGNAL(stepInserted(int)), SIGNAL(updateSummary()));
connect(list, SIGNAL(stepMoved(int,int)), SIGNAL(updateSummary()));
connect(list, SIGNAL(stepRemoved(int)), SIGNAL(updateSummary()));
connect(list, SIGNAL(aboutToRemoveStep(int)),
SLOT(handleStepToBeRemoved(int)));
}
RemoteLinuxDeployStepWidget::~RemoteLinuxDeployStepWidget()
{
}
void RemoteLinuxDeployStepWidget::handleStepToBeRemoved(int step)
{
BuildStepList * const list = m_step->deployConfiguration()->stepList();
const AbstractRemoteLinuxDeployStep * const alds
= qobject_cast<AbstractRemoteLinuxDeployStep *>(list->steps().at(step));
if (alds && alds == m_step)
disconnect(list, 0, this, 0);
}
QString RemoteLinuxDeployStepWidget::summaryText() const
{
return tr("<b>%1</b>").arg(m_step->displayName());
}
} // namespace RemoteLinux

View File

@@ -1,64 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** 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.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef REMOTELINUXDEPLOYSTEPWIDGET_H
#define REMOTELINUXDEPLOYSTEPWIDGET_H
#include "remotelinux_export.h"
#include <projectexplorer/buildstep.h>
namespace RemoteLinux {
class AbstractRemoteLinuxDeployStep;
class REMOTELINUX_EXPORT RemoteLinuxDeployStepWidget : public ProjectExplorer::BuildStepConfigWidget
{
Q_OBJECT
public:
RemoteLinuxDeployStepWidget(AbstractRemoteLinuxDeployStep *step);
~RemoteLinuxDeployStepWidget();
QString summaryText() const;
QString displayName() const { return QString(); }
AbstractRemoteLinuxDeployStep *step() const { return m_step; }
private:
Q_SLOT void handleStepToBeRemoved(int step);
AbstractRemoteLinuxDeployStep * const m_step;
};
} // namespace RemoteLinux
#endif // REMOTELINUXDEPLOYSTEPWIDGET_H

View File

@@ -47,32 +47,25 @@ using namespace ProjectExplorer;
namespace RemoteLinux { namespace RemoteLinux {
namespace { namespace {
class CreateTarStepWidget : public BuildStepConfigWidget class CreateTarStepWidget : public SimpleBuildStepConfigWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
CreateTarStepWidget(TarPackageCreationStep *step) : m_step(step) CreateTarStepWidget(TarPackageCreationStep *step) : SimpleBuildStepConfigWidget(step)
{ {
connect(m_step, SIGNAL(packageFilePathChanged()), SIGNAL(updateSummary())); connect(step, SIGNAL(packageFilePathChanged()), SIGNAL(updateSummary()));
} }
QString summaryText() const QString summaryText() const
{ {
if (m_step->packageFilePath().isEmpty()) { TarPackageCreationStep * const step = qobject_cast<TarPackageCreationStep *>(this->step());
if (step->packageFilePath().isEmpty()) {
return QLatin1String("<font color=\"red\">") return QLatin1String("<font color=\"red\">")
+ tr("Tarball creation not possible.") + QLatin1String("</font>"); + tr("Tarball creation not possible.") + QLatin1String("</font>");
} }
return QLatin1String("<b>") + tr("Create tarball:") + QLatin1String("</b> ") return QLatin1String("<b>") + tr("Create tarball:") + QLatin1String("</b> ")
+ m_step->packageFilePath(); + step->packageFilePath();
} }
QString displayName() const { return QString(); }
bool showWidget() const { return false; }
private:
const TarPackageCreationStep * const m_step;
}; };

View File

@@ -32,7 +32,6 @@
#include "uploadandinstalltarpackagestep.h" #include "uploadandinstalltarpackagestep.h"
#include "remotelinuxdeployconfiguration.h" #include "remotelinuxdeployconfiguration.h"
#include "remotelinuxdeploystepwidget.h"
#include "remotelinuxpackageinstaller.h" #include "remotelinuxpackageinstaller.h"
#include "tarpackagecreationstep.h" #include "tarpackagecreationstep.h"
@@ -42,26 +41,6 @@ using namespace ProjectExplorer;
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal { namespace Internal {
namespace {
class ConfigWidget : public BuildStepConfigWidget
{
Q_OBJECT
public:
ConfigWidget(UploadAndInstallTarPackageStep *step) : m_widget(step)
{
connect(&m_widget, SIGNAL(updateSummary()), SIGNAL(updateSummary()));
}
~ConfigWidget() {}
private:
QString summaryText() const { return m_widget.summaryText(); }
QString displayName() const { return m_widget.displayName(); }
bool showWidget() const { return false; }
RemoteLinuxDeployStepWidget m_widget;
};
} // anonymous namespace
class UploadAndInstallTarPackageServicePrivate class UploadAndInstallTarPackageServicePrivate
{ {
@@ -124,7 +103,7 @@ bool UploadAndInstallTarPackageStep::initInternal(QString *error)
BuildStepConfigWidget *UploadAndInstallTarPackageStep::createConfigWidget() BuildStepConfigWidget *UploadAndInstallTarPackageStep::createConfigWidget()
{ {
return new ConfigWidget(this); return new SimpleBuildStepConfigWidget(this);
} }
QString UploadAndInstallTarPackageStep::stepId() QString UploadAndInstallTarPackageStep::stepId()
@@ -138,5 +117,3 @@ QString UploadAndInstallTarPackageStep::displayName()
} }
} //namespace RemoteLinux } //namespace RemoteLinux
#include "uploadandinstalltarpackagestep.moc"