OSDN Git Service

Remove warning about invalid run configurations
authorTobias Hunger <tobias.hunger@nokia.com>
Fri, 26 Nov 2010 16:10:25 +0000 (17:10 +0100)
committerTobias Hunger <tobias.hunger@nokia.com>
Fri, 26 Nov 2010 16:19:23 +0000 (17:19 +0100)
Reviewed-by: dt
src/plugins/projectexplorer/buildconfigdialog.cpp [deleted file]
src/plugins/projectexplorer/buildconfigdialog.h [deleted file]
src/plugins/projectexplorer/projectexplorer.cpp
src/plugins/projectexplorer/projectexplorer.h
src/plugins/projectexplorer/projectexplorer.pro

diff --git a/src/plugins/projectexplorer/buildconfigdialog.cpp b/src/plugins/projectexplorer/buildconfigdialog.cpp
deleted file mode 100644 (file)
index 32e018e..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/**************************************************************************
-**
-** This file is part of Qt Creator
-**
-** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-**
-** 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 "buildconfigdialog.h"
-#include "project.h"
-#include "runconfiguration.h"
-#include "buildconfiguration.h"
-#include "target.h"
-
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QPushButton>
-#include <QtGui/QDialogButtonBox>
-#include <QtGui/QLabel>
-#include <QtGui/QComboBox>
-#include <QtGui/QFormLayout>
-
-namespace ProjectExplorer {
-namespace Internal {
-
-BuildConfigDialog::BuildConfigDialog(Project *project, QWidget *parent)
-    : QDialog(parent),
-    m_project(project)
-{
-    QVBoxLayout *vlayout = new QVBoxLayout;
-    setLayout(vlayout);
-    QDialogButtonBox *buttonBox = new QDialogButtonBox;
-    m_changeBuildConfiguration = buttonBox->addButton(tr("Change build configuration && continue"),
-        QDialogButtonBox::ActionRole);
-    m_cancel = buttonBox->addButton(tr("Cancel"),
-        QDialogButtonBox::RejectRole);
-    m_justContinue = buttonBox->addButton(tr("Continue anyway"),
-        QDialogButtonBox::AcceptRole);
-    connect(m_changeBuildConfiguration, SIGNAL(clicked()), this, SLOT(buttonClicked()));
-    connect(m_cancel, SIGNAL(clicked()), this, SLOT(buttonClicked()));
-    connect(m_justContinue, SIGNAL(clicked()), this, SLOT(buttonClicked()));
-    setWindowTitle(tr("Run configuration does not match build configuration"));
-    QLabel *shortText = new QLabel(tr(
-            "The active build configuration builds a target "
-            "that cannot be used by the active run configuration."
-            ));
-    vlayout->addWidget(shortText);
-    QLabel *descriptiveText = new QLabel(tr(
-        "This can happen if the active build configuration "
-        "uses the wrong Qt version and/or tool chain for the active run configuration "
-        "(for example, running in Symbian emulator requires building with the WINSCW tool chain)."
-    ));
-    descriptiveText->setWordWrap(true);
-    vlayout->addWidget(descriptiveText);
-    m_configCombo = new QComboBox;
-
-    RunConfiguration *activeRun = m_project->activeTarget()->activeRunConfiguration();
-    foreach (BuildConfiguration *config, m_project->activeTarget()->buildConfigurations()) {
-        if (activeRun->isEnabled(config)) {
-            m_configCombo->addItem(config->displayName(), QVariant::fromValue(config));
-        }
-    }
-    if (m_configCombo->count() == 0) {
-        m_configCombo->addItem(tr("No valid build configuration found."));
-        m_configCombo->setEnabled(false);
-        m_changeBuildConfiguration->setEnabled(false);
-    }
-
-    QFormLayout *formlayout = new QFormLayout;
-    formlayout->addRow(tr("Active run configuration"),
-                       // ^ avoiding a new translatable string for active run configuration
-                       new QLabel(activeRun->displayName()));
-    formlayout->addRow(tr("Choose build configuration:"), m_configCombo);
-    vlayout->addLayout(formlayout);
-    vlayout->addWidget(buttonBox);
-    m_cancel->setDefault(true);
-}
-
-BuildConfiguration *BuildConfigDialog::selectedBuildConfiguration() const
-{
-    int index = m_configCombo->currentIndex();
-    if (index < 0)
-        return 0;
-    return m_configCombo->itemData(index, Qt::UserRole).value<BuildConfiguration*>();
-}
-
-void BuildConfigDialog::buttonClicked()
-{
-    QPushButton *button = qobject_cast<QPushButton *>(sender());
-    if (button == m_changeBuildConfiguration) {
-        done(ChangeBuild);
-    } else if (button == m_cancel) {
-        done(Cancel);
-    } else if (button == m_justContinue) {
-        done(Continue);
-    }
-}
-
-} // namespace Internal
-} // namespace ProjectExplorer
diff --git a/src/plugins/projectexplorer/buildconfigdialog.h b/src/plugins/projectexplorer/buildconfigdialog.h
deleted file mode 100644 (file)
index a3e4066..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/**************************************************************************
-**
-** This file is part of Qt Creator
-**
-** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-**
-** 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.
-**
-**************************************************************************/
-
-#ifndef BUILDCONFIGDIALOG_H
-#define BUILDCONFIGDIALOG_H
-
-#include <QtGui/QDialog>
-
-QT_BEGIN_NAMESPACE
-class QAction;
-class QComboBox;
-QT_END_NAMESPACE
-
-namespace ProjectExplorer {
-class Project;
-class BuildConfiguration;
-
-namespace Internal {
-
-class BuildConfigDialog : public QDialog
-{
-    Q_OBJECT
-public:
-    enum DialogResult {
-        ChangeBuild = 10,
-        Cancel = 11,
-        Continue = 12
-    };
-    explicit BuildConfigDialog(Project *project, QWidget *parent = 0);
-
-    BuildConfiguration *selectedBuildConfiguration() const;
-
-private slots:
-    void buttonClicked();
-
-private:
-    Project *m_project;
-    QPushButton *m_changeBuildConfiguration;
-    QPushButton *m_cancel;
-    QPushButton *m_justContinue;
-    QComboBox *m_configCombo;
-};
-
-} // namespace Internal
-} // namespace ProjectExplorer
-
-#endif // BUILDCONFIGDIALOG_H
index e9e0a77..027e399 100644 (file)
@@ -73,7 +73,6 @@
 #include "projectwelcomepagewidget.h"
 #include "corelistenercheckingforrunningbuild.h"
 #include "buildconfiguration.h"
-#include "buildconfigdialog.h"
 #include "miniprojecttargetselector.h"
 #include "taskhub.h"
 #include "publishing/ipublishingwizardfactory.h"
@@ -1749,10 +1748,8 @@ void ProjectExplorerPlugin::runProject(Project *pro, QString mode)
     if (!pro)
         return;
 
-    if (!pro->activeTarget()->activeRunConfiguration()->isEnabled()) {
-        if (!showBuildConfigDialog())
-            return;
-    }
+    if (!pro->activeTarget()->activeRunConfiguration()->isEnabled())
+        return;
 
     QStringList stepIds;
     if (d->m_projectExplorerSettings.deployBeforeRun) {
@@ -1776,31 +1773,6 @@ void ProjectExplorerPlugin::runProject(Project *pro, QString mode)
     emit updateRunActions();
 }
 
-bool ProjectExplorerPlugin::showBuildConfigDialog()
-{
-    Project *pro = startupProject();
-    BuildConfigDialog *dialog = new BuildConfigDialog(pro,
-                                                      Core::ICore::instance()->mainWindow());
-    dialog->exec();
-    BuildConfiguration *otherConfig = dialog->selectedBuildConfiguration();
-    int result = dialog->result();
-    dialog->deleteLater();
-    switch (result) {
-    case BuildConfigDialog::ChangeBuild:
-        if (otherConfig) {
-            pro->activeTarget()->setActiveBuildConfiguration(otherConfig);
-            return true;
-        }
-        return false;
-    case BuildConfigDialog::Cancel:
-        return false;
-    case BuildConfigDialog::Continue:
-        return true;
-    default:
-        return false;
-    }
-}
-
 void ProjectExplorerPlugin::runControlFinished()
 {
     emit updateRunActions();
index 324a904..031f3dc 100644 (file)
@@ -234,8 +234,6 @@ private:
     bool hasBuildSettings(Project *pro);
     bool hasDeploySettings(Project *pro);
 
-    bool showBuildConfigDialog();
-
     void setCurrent(Project *project, QString filePath, Node *node);
 
     QStringList allFilesWithDependencies(Project *pro);
index 11b3873..3336419 100644 (file)
@@ -85,7 +85,6 @@ HEADERS += projectexplorer.h \
     targetsettingswidget.h \
     doubletabwidget.h \
     buildenvironmentwidget.h \
-    buildconfigdialog.h \
     ldparser.h \
     linuxiccparser.h \
     outputformatter.h \
@@ -170,7 +169,6 @@ SOURCES += projectexplorer.cpp \
     targetsettingswidget.cpp \
     doubletabwidget.cpp \
     buildenvironmentwidget.cpp \
-    buildconfigdialog.cpp \
     ldparser.cpp \
     linuxiccparser.cpp \
     outputformatter.cpp \