diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index d0eb7f223dccf7564a9500a27fd168fc23fe2998..7f45fc994794b91166be04d606a783127edf1986 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 476e50e50c6869c892943fed08e5750617434f43..5531fa55727d9fe1eb00e52d5959146e4ed3ebad 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 641e9fd26d623ec776dedf22b15a3d37d1c1fd8d..ee8ba9d8bd0850f4a5edc49ad04fbf0e277abde2 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 bdf98dec2282df46d641c00442377d8826aa9418..4140a1b9532112c56b675c8d260966f32cfe4717 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 8323ce6b07c32d6522f205b5488df154703f8bb0..7ac2818b0e067be2951ba893bed0a3002aa06fc2 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 00990e0252060ae20e711e81f440262a383bbf5c..184f91c21ac07b7b6adb03c51284ce67cbc0f720 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 0798243f85ad4ef6f719f03bc1041eb73c8be86f..a05c0b64df77a991e66e3427e7f19e94507c4a57 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 7b76707c5f5f909e0ea38e81f6780ecb390b6214..0000000000000000000000000000000000000000 --- 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 54e047e0f9a0512f145f0510ca1e861fd3f18bfc..0000000000000000000000000000000000000000 --- 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 33d47e3ce77dfcb803e719a58d797bb2065c7a1f..c31b09bf9bc96a0bbcdd5eebec0ee06868893743 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 22dc896c42f5246dcd5f7780318d4afeec3c6361..918e05aba926625bff120fd3d7f7c0de4fb61150 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"