Commit 3adea203 authored by Daniel Teske's avatar Daniel Teske

ProjectExplorer: Remove IPublishWizard

Cleanup overlooked in Madde removal patch.

Change-Id: I150e33a5b4602b7943f3a48e2b2076fae9f34a9e
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@digia.com>
parent 81d4a522
......@@ -81,8 +81,6 @@
#include "devicesupport/desktopdevicefactory.h"
#include "devicesupport/devicemanager.h"
#include "devicesupport/devicesettingspage.h"
#include "publishing/ipublishingwizardfactory.h"
#include "publishing/publishingwizardselectiondialog.h"
#ifdef Q_OS_WIN
# include "windebuginterface.h"
......@@ -97,6 +95,7 @@
#endif
#include <extensionsystem/pluginspec.h>
#include <extensionsystem/pluginmanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/id.h>
......@@ -190,7 +189,6 @@ struct ProjectExplorerPluginPrivate {
Utils::ParameterAction *m_deployAction;
QAction *m_deployActionContextMenu;
QAction *m_deploySessionAction;
Utils::ParameterAction *m_publishAction;
Utils::ParameterAction *m_cleanAction;
QAction *m_cleanActionContextMenu;
QAction *m_cleanSessionAction;
......@@ -737,14 +735,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
cmd = ActionManager::registerAction(d->m_runWithoutDeployAction, Constants::RUNWITHOUTDEPLOY, globalcontext);
mbuild->addAction(cmd, Constants::G_BUILD_RUN);
// Publish action
d->m_publishAction = new Utils::ParameterAction(tr("Publish Project..."), tr("Publish Project \"%1\"..."),
Utils::ParameterAction::AlwaysEnabled, this);
cmd = ActionManager::registerAction(d->m_publishAction, Constants::PUBLISH, globalcontext);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(d->m_publishAction->text());
mbuild->addAction(cmd, Constants::G_BUILD_RUN);
// build action (context menu)
d->m_buildActionContextMenu = new QAction(tr("Build"), this);
cmd = ActionManager::registerAction(d->m_buildActionContextMenu, Constants::BUILDCM, projecTreeContext);
......@@ -960,7 +950,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
connect(d->m_deployAction, SIGNAL(triggered()), this, SLOT(deployProject()));
connect(d->m_deployActionContextMenu, SIGNAL(triggered()), this, SLOT(deployProjectContextMenu()));
connect(d->m_deploySessionAction, SIGNAL(triggered()), this, SLOT(deploySession()));
connect(d->m_publishAction, SIGNAL(triggered()), this, SLOT(publishProject()));
connect(d->m_cleanProjectOnlyAction, SIGNAL(triggered()), this, SLOT(cleanProjectOnly()));
connect(d->m_cleanAction, SIGNAL(triggered()), this, SLOT(cleanProject()));
connect(d->m_cleanActionContextMenu, SIGNAL(triggered()), this, SLOT(cleanProjectContextMenu()));
......@@ -1250,19 +1239,6 @@ void ProjectExplorerPlugin::setStartupProject(Project *project)
updateActions();
}
void ProjectExplorerPlugin::publishProject()
{
const Project * const project = SessionManager::startupProject();
QTC_ASSERT(project, return);
PublishingWizardSelectionDialog selectionDialog(project);
if (selectionDialog.exec() == QDialog::Accepted) {
QWizard * const publishingWizard
= selectionDialog.createSelectedWizard();
publishingWizard->exec();
delete publishingWizard;
}
}
void ProjectExplorerPlugin::savePersistentSettings()
{
if (debug)
......@@ -1860,7 +1836,6 @@ void ProjectExplorerPlugin::updateActions()
d->m_buildAction->setParameter(projectName);
d->m_rebuildAction->setParameter(projectName);
d->m_cleanAction->setParameter(projectName);
d->m_publishAction->setParameter(projectName);
d->m_buildAction->setEnabled(buildActionState.first);
d->m_rebuildAction->setEnabled(buildActionState.first);
......@@ -1914,19 +1889,6 @@ void ProjectExplorerPlugin::updateActions()
d->m_cancelBuildAction->setEnabled(BuildManager::isBuilding());
bool canPublish = false;
if (project) {
const QList<IPublishingWizardFactory *> &factories
= ExtensionSystem::PluginManager::getObjects<IPublishingWizardFactory>();
foreach (const IPublishingWizardFactory *const factory, factories) {
if (factory->canCreateWizard(project)) {
canPublish = true;
break;
}
}
}
d->m_publishAction->setEnabled(canPublish);
const bool hasProjects = SessionManager::hasProjects();
d->m_projectSelectorAction->setEnabled(hasProjects);
d->m_projectSelectorActionMenu->setEnabled(hasProjects);
......
......@@ -224,7 +224,6 @@ private slots:
void updateVariable(const QByteArray &variable);
void updateRunWithoutDeployMenu();
void publishProject();
void updateWelcomePage();
void updateExternalFileWarning();
......
......@@ -105,8 +105,6 @@ HEADERS += projectexplorer.h \
taskhub.h \
localapplicationruncontrol.h \
metatypedeclarations.h \
publishing/publishingwizardselectiondialog.h \
publishing/ipublishingwizardfactory.h \
headerpath.h \
gcctoolchainfactories.h \
appoutputpane.h \
......@@ -240,7 +238,6 @@ SOURCES += projectexplorer.cpp \
taskhub.cpp \
processparameters.cpp \
localapplicationruncontrol.cpp \
publishing/publishingwizardselectiondialog.cpp \
appoutputpane.cpp \
codestylesettingspropertiespage.cpp \
settingsaccessor.cpp \
......@@ -281,7 +278,6 @@ FORMS += processstep.ui \
projectexplorersettingspage.ui \
targetsettingswidget.ui \
doubletabwidget.ui \
publishing/publishingwizardselectiondialog.ui \
codestylesettingspropertiespage.ui \
devicesupport/devicefactoryselectiondialog.ui \
devicesupport/devicesettingswidget.ui \
......
......@@ -246,15 +246,6 @@ QtcPlugin {
]
}
Group {
name: "Publishing"
prefix: "publishing/"
files: [
"ipublishingwizardfactory.h",
"publishingwizardselectiondialog.cpp", "publishingwizardselectiondialog.h", "publishingwizardselectiondialog.ui",
]
}
Group {
name: "WindowsToolChains"
condition: qbs.targetOS.contains("windows") || project.testsEnabled
......
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** 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.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef IPUBLISHING_WIZARD_FACTORY_H
#define IPUBLISHING_WIZARD_FACTORY_H
#include <projectexplorer/projectexplorer_export.h>
#include <extensionsystem/pluginmanager.h>
#include <QList>
#include <QWizard>
namespace ProjectExplorer {
class Project;
class PROJECTEXPLORER_EXPORT IPublishingWizardFactory : public QObject
{
Q_OBJECT
public:
virtual QString displayName() const = 0;
virtual QString description() const = 0;
virtual bool canCreateWizard(const Project *project) const = 0;
virtual QWizard *createWizard(const Project *project) const = 0;
protected:
IPublishingWizardFactory(QObject *parent = 0) : QObject(parent) {}
};
} // namespace ProjectExplorer
#endif // IPUBLISHING_WIZARD_FACTORY_H
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** 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.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "publishingwizardselectiondialog.h"
#include "ui_publishingwizardselectiondialog.h"
#include "ipublishingwizardfactory.h"
#include <projectexplorer/project.h>
#include <QPushButton>
namespace ProjectExplorer {
namespace Internal {
PublishingWizardSelectionDialog::PublishingWizardSelectionDialog(const Project *project,
QWidget *parent) :
QDialog(parent),
ui(new Ui::PublishingWizardSelectionDialog),
m_project(project)
{
ui->setupUi(this);
ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Start Wizard"));
const QList<IPublishingWizardFactory *> &factories
= ExtensionSystem::PluginManager::getObjects<IPublishingWizardFactory>();
foreach (const IPublishingWizardFactory * const factory, factories) {
if (factory->canCreateWizard(project)) {
m_factories << factory;
ui->serviceComboBox->addItem(factory->displayName());
}
}
if (!m_factories.isEmpty()) {
connect(ui->serviceComboBox, SIGNAL(currentIndexChanged(int)),
SLOT(handleWizardIndexChanged(int)));
ui->serviceComboBox->setCurrentIndex(0);
handleWizardIndexChanged(ui->serviceComboBox->currentIndex());
} else {
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
ui->descriptionTextArea->appendHtml(QLatin1String("<font color=\"red\">")
+ tr("Publishing is currently not possible for project '%1'.")
.arg(project->displayName())
+ QLatin1String("</font>"));
}
}
PublishingWizardSelectionDialog::~PublishingWizardSelectionDialog()
{
delete ui;
}
QWizard *PublishingWizardSelectionDialog::createSelectedWizard() const
{
return m_factories.at(ui->serviceComboBox->currentIndex())->createWizard(m_project);
}
void PublishingWizardSelectionDialog::handleWizardIndexChanged(int index)
{
ui->descriptionTextArea->setPlainText(m_factories.at(index)->description());
}
} // namespace Internal
} // namespace ProjectExplorer
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** 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.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef PUBLISHINGWIZARDSELECTIONDIALOG_H
#define PUBLISHINGWIZARDSELECTIONDIALOG_H
#include <QList>
#include <QDialog>
QT_FORWARD_DECLARE_CLASS(QWizard)
namespace ProjectExplorer {
class IPublishingWizardFactory;
class Project;
namespace Internal {
namespace Ui {
class PublishingWizardSelectionDialog;
}
class PublishingWizardSelectionDialog : public QDialog
{
Q_OBJECT
public:
explicit PublishingWizardSelectionDialog(const Project *project,
QWidget *parent = 0);
~PublishingWizardSelectionDialog();
QWizard *createSelectedWizard() const;
private slots:
void handleWizardIndexChanged(int index);
private:
Ui::PublishingWizardSelectionDialog *ui;
const Project * const m_project;
QList<const IPublishingWizardFactory *> m_factories;
};
} // namespace Internal
} // namespace ProjectExplorer
#endif // PUBLISHINGWIZARDSELECTIONDIALOG_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ProjectExplorer::Internal::PublishingWizardSelectionDialog</class>
<widget class="QDialog" name="ProjectExplorer::Internal::PublishingWizardSelectionDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>409</width>
<height>330</height>
</rect>
</property>
<property name="windowTitle">
<string>Publishing Wizard Selection</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Available Wizards:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="serviceComboBox"/>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QPlainTextEdit" name="descriptionTextArea">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>ProjectExplorer::Internal::PublishingWizardSelectionDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>ProjectExplorer::Internal::PublishingWizardSelectionDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment