summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@nokia.com>2012-01-09 16:23:40 +0100
committerNikolai Kosjar <nikolai.kosjar@nokia.com>2012-01-11 16:02:19 +0100
commitf75abb341ecd6f7f11a9b9ae01605135f3953ca3 (patch)
tree1bc0a8db566fc0e9bf61db9cdf9a3b9c4552aa08 /src
parent2d88b3d90584016bf603b659cbeeff4624f547e5 (diff)
downloadqt-creator-f75abb341ecd6f7f11a9b9ae01605135f3953ca3.tar.gz
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>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/projectexplorer/buildstep.h22
-rw-r--r--src/plugins/qt4projectmanager/qt-s60/s60deploystep.cpp25
-rw-r--r--src/plugins/qt4projectmanager/qt-s60/s60deploystep.h11
-rw-r--r--src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp3
-rw-r--r--src/plugins/remotelinux/genericdirectuploadstep.cpp3
-rw-r--r--src/plugins/remotelinux/remotelinux.pro2
-rw-r--r--src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp4
-rw-r--r--src/plugins/remotelinux/remotelinuxdeploystepwidget.cpp77
-rw-r--r--src/plugins/remotelinux/remotelinuxdeploystepwidget.h64
-rw-r--r--src/plugins/remotelinux/tarpackagecreationstep.cpp19
-rw-r--r--src/plugins/remotelinux/uploadandinstalltarpackagestep.cpp25
11 files changed, 34 insertions, 221 deletions
diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h
index d0eb7f223d..7f45fc9947 100644
--- a/src/plugins/projectexplorer/buildstep.h
+++ b/src/plugins/projectexplorer/buildstep.h
@@ -147,6 +147,28 @@ signals:
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
Q_DECLARE_METATYPE(ProjectExplorer::BuildStep::OutputFormat)
diff --git a/src/plugins/qt4projectmanager/qt-s60/s60deploystep.cpp b/src/plugins/qt4projectmanager/qt-s60/s60deploystep.cpp
index 476e50e50c..5531fa5572 100644
--- a/src/plugins/qt4projectmanager/qt-s60/s60deploystep.cpp
+++ b/src/plugins/qt4projectmanager/qt-s60/s60deploystep.cpp
@@ -135,7 +135,7 @@ S60DeployStep::S60DeployStep(ProjectExplorer::BuildStepList *bc):
void S60DeployStep::ctor()
{
//: Qt4 Deploystep display name
- setDefaultDisplayName(tr("Deploy"));
+ setDefaultDisplayName(tr("Deploy SIS Package"));
m_timeoutTimer->setSingleShot(true);
m_timeoutTimer->setInterval(10000);
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."));
}
-// #pragma mark -- S60DeployStepWidget
-
BuildStepConfigWidget *S60DeployStep::createConfigWidget()
{
- return new S60DeployStepWidget();
-}
-
-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;
+ return new SimpleBuildStepConfigWidget(this);
}
// #pragma mark -- S60DeployStepFactory
diff --git a/src/plugins/qt4projectmanager/qt-s60/s60deploystep.h b/src/plugins/qt4projectmanager/qt-s60/s60deploystep.h
index 641e9fd26d..ee8ba9d8bd 100644
--- a/src/plugins/qt4projectmanager/qt-s60/s60deploystep.h
+++ b/src/plugins/qt4projectmanager/qt-s60/s60deploystep.h
@@ -207,17 +207,6 @@ private:
int m_copyProgress;
};
-class S60DeployStepWidget : public ProjectExplorer::BuildStepConfigWidget
-{
- Q_OBJECT
-public:
- S60DeployStepWidget();
-
- QString summaryText() const;
- QString displayName() const;
- bool showWidget() const;
-};
-
} // Internal
} // Qt4ProjectManager
diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp
index bdf98dec22..4140a1b953 100644
--- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp
+++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp
@@ -33,7 +33,6 @@
#include "abstractremotelinuxdeployservice.h"
#include "remotelinuxdeployconfiguration.h"
-#include "remotelinuxdeploystepwidget.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
@@ -115,7 +114,7 @@ void AbstractRemoteLinuxDeployStep::cancel()
BuildStepConfigWidget *AbstractRemoteLinuxDeployStep::createConfigWidget()
{
- return new RemoteLinuxDeployStepWidget(this);
+ return new SimpleBuildStepConfigWidget(this);
}
RemoteLinuxDeployConfiguration *AbstractRemoteLinuxDeployStep::deployConfiguration() const
diff --git a/src/plugins/remotelinux/genericdirectuploadstep.cpp b/src/plugins/remotelinux/genericdirectuploadstep.cpp
index 8323ce6b07..7ac2818b0e 100644
--- a/src/plugins/remotelinux/genericdirectuploadstep.cpp
+++ b/src/plugins/remotelinux/genericdirectuploadstep.cpp
@@ -35,7 +35,6 @@
#include "deploymentinfo.h"
#include "genericdirectuploadservice.h"
#include "remotelinuxdeployconfiguration.h"
-#include "remotelinuxdeploystepwidget.h"
#include <QtGui/QCheckBox>
#include <QtGui/QVBoxLayout>
@@ -78,7 +77,7 @@ private:
myStep()->setIncrementalDeployment(incremental);
}
- RemoteLinuxDeployStepWidget m_widget;
+ SimpleBuildStepConfigWidget m_widget;
QCheckBox m_incrementalCheckBox;
};
diff --git a/src/plugins/remotelinux/remotelinux.pro b/src/plugins/remotelinux/remotelinux.pro
index 00990e0252..184f91c21a 100644
--- a/src/plugins/remotelinux/remotelinux.pro
+++ b/src/plugins/remotelinux/remotelinux.pro
@@ -47,7 +47,6 @@ HEADERS += \
linuxdevicetestdialog.h \
remotelinuxprocesslist.h \
remotelinuxprocessesdialog.h \
- remotelinuxdeploystepwidget.h \
linuxdeviceconfigurationssettingswidget.h \
remotelinuxenvironmentreader.h \
sshkeydeployer.h \
@@ -103,7 +102,6 @@ SOURCES += \
linuxdevicetestdialog.cpp \
remotelinuxprocesslist.cpp \
remotelinuxprocessesdialog.cpp \
- remotelinuxdeploystepwidget.cpp \
linuxdeviceconfigurationssettingswidget.cpp \
remotelinuxenvironmentreader.cpp \
sshkeydeployer.cpp \
diff --git a/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp b/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp
index 0798243f85..a05c0b64df 100644
--- a/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp
+++ b/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp
@@ -31,8 +31,6 @@
**************************************************************************/
#include "remotelinuxcustomcommanddeploymentstep.h"
-#include "remotelinuxdeploystepwidget.h"
-
#include <QtCore/QString>
#include <QtGui/QHBoxLayout>
#include <QtGui/QLabel>
@@ -80,7 +78,7 @@ private:
AbstractRemoteLinuxCustomCommandDeploymentStep * const m_step;
QLineEdit m_commandLineEdit;
- RemoteLinuxDeployStepWidget m_widget;
+ SimpleBuildStepConfigWidget m_widget;
};
} // anonymous namespace
diff --git a/src/plugins/remotelinux/remotelinuxdeploystepwidget.cpp b/src/plugins/remotelinux/remotelinuxdeploystepwidget.cpp
deleted file mode 100644
index 7b76707c5f..0000000000
--- a/src/plugins/remotelinux/remotelinuxdeploystepwidget.cpp
+++ /dev/null
@@ -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
diff --git a/src/plugins/remotelinux/remotelinuxdeploystepwidget.h b/src/plugins/remotelinux/remotelinuxdeploystepwidget.h
deleted file mode 100644
index 54e047e0f9..0000000000
--- a/src/plugins/remotelinux/remotelinuxdeploystepwidget.h
+++ /dev/null
@@ -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
diff --git a/src/plugins/remotelinux/tarpackagecreationstep.cpp b/src/plugins/remotelinux/tarpackagecreationstep.cpp
index 33d47e3ce7..c31b09bf9b 100644
--- a/src/plugins/remotelinux/tarpackagecreationstep.cpp
+++ b/src/plugins/remotelinux/tarpackagecreationstep.cpp
@@ -47,32 +47,25 @@ using namespace ProjectExplorer;
namespace RemoteLinux {
namespace {
-class CreateTarStepWidget : public BuildStepConfigWidget
+class CreateTarStepWidget : public SimpleBuildStepConfigWidget
{
Q_OBJECT
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
{
- if (m_step->packageFilePath().isEmpty()) {
+ TarPackageCreationStep * const step = qobject_cast<TarPackageCreationStep *>(this->step());
+ if (step->packageFilePath().isEmpty()) {
return QLatin1String("<font color=\"red\">")
+ tr("Tarball creation not possible.") + QLatin1String("</font>");
}
-
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;
};
diff --git a/src/plugins/remotelinux/uploadandinstalltarpackagestep.cpp b/src/plugins/remotelinux/uploadandinstalltarpackagestep.cpp
index 22dc896c42..918e05aba9 100644
--- a/src/plugins/remotelinux/uploadandinstalltarpackagestep.cpp
+++ b/src/plugins/remotelinux/uploadandinstalltarpackagestep.cpp
@@ -32,7 +32,6 @@
#include "uploadandinstalltarpackagestep.h"
#include "remotelinuxdeployconfiguration.h"
-#include "remotelinuxdeploystepwidget.h"
#include "remotelinuxpackageinstaller.h"
#include "tarpackagecreationstep.h"
@@ -42,26 +41,6 @@ using namespace ProjectExplorer;
namespace RemoteLinux {
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
{
@@ -124,7 +103,7 @@ bool UploadAndInstallTarPackageStep::initInternal(QString *error)
BuildStepConfigWidget *UploadAndInstallTarPackageStep::createConfigWidget()
{
- return new ConfigWidget(this);
+ return new SimpleBuildStepConfigWidget(this);
}
QString UploadAndInstallTarPackageStep::stepId()
@@ -138,5 +117,3 @@ QString UploadAndInstallTarPackageStep::displayName()
}
} //namespace RemoteLinux
-
-#include "uploadandinstalltarpackagestep.moc"