forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.3'
Change-Id: I4a21e9a9f4c5c2f96ad03ee6ea65afcd0ca511f9
This commit is contained in:
@@ -4,7 +4,7 @@ QTCREATOR_PRI_INCLUDED = 1
|
||||
QTCREATOR_VERSION = 4.2.82
|
||||
QTCREATOR_COMPAT_VERSION = 4.2.82
|
||||
VERSION = $$QTCREATOR_VERSION
|
||||
BINARY_ARTIFACTS_BRANCH = master
|
||||
BINARY_ARTIFACTS_BRANCH = 4.3
|
||||
|
||||
CONFIG += c++14
|
||||
|
||||
|
@@ -473,6 +473,8 @@ QRectF QuickItemNodeInstance::boundingRectWithStepChilds(QQuickItem *parentItem)
|
||||
{
|
||||
QRectF boundingRect = parentItem->boundingRect();
|
||||
|
||||
boundingRect = boundingRect.united(QRectF(QPointF(0, 0), size()));
|
||||
|
||||
foreach (QQuickItem *childItem, parentItem->childItems()) {
|
||||
if (!nodeInstanceServer()->hasInstanceForObject(childItem)) {
|
||||
QRectF transformedRect = childItem->mapRectToItem(parentItem, boundingRectWithStepChilds(childItem));
|
||||
|
@@ -60,8 +60,7 @@ public:
|
||||
QStringList mimeTypes() const;
|
||||
QMimeData *mimeData(const QModelIndexList &indexes) const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void rebuild(CPlusPlus::Document::Ptr doc);
|
||||
void rebuild(Document::Ptr doc);
|
||||
|
||||
private:
|
||||
bool hasDocument() const;
|
||||
|
@@ -77,7 +77,8 @@ public:
|
||||
|
||||
void exec()
|
||||
{
|
||||
if (schedule()) // do not enter event loop for empty containers
|
||||
// do not enter event loop for empty containers or if already canceled
|
||||
if (!m_futureInterface.isCanceled() && schedule())
|
||||
m_loop.exec();
|
||||
}
|
||||
|
||||
|
@@ -148,8 +148,7 @@ void BareMetalDebugSupport::startExecution()
|
||||
auto dev = qSharedPointerCast<const BareMetalDevice>(m_runControl->device());
|
||||
QTC_ASSERT(dev, return);
|
||||
|
||||
const GdbServerProvider *p = GdbServerProviderManager::instance()->findProvider(
|
||||
dev->gdbServerProviderId());
|
||||
const GdbServerProvider *p = GdbServerProviderManager::findProvider(dev->gdbServerProviderId());
|
||||
QTC_ASSERT(p, return);
|
||||
|
||||
m_state = StartingRunner;
|
||||
|
@@ -43,7 +43,9 @@ public:
|
||||
explicit BareMetalDebugSupport(Debugger::DebuggerRunControl *runControl);
|
||||
~BareMetalDebugSupport();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
enum State { Inactive, StartingRunner, Running };
|
||||
|
||||
void remoteSetupRequested();
|
||||
void debuggingFinished();
|
||||
void remoteOutputMessage(const QByteArray &output);
|
||||
@@ -53,9 +55,6 @@ private slots:
|
||||
void progressReport(const QString &progressOutput);
|
||||
void appRunnerError(const QString &error);
|
||||
|
||||
private:
|
||||
enum State { Inactive, StartingRunner, Running };
|
||||
|
||||
void adapterSetupDone();
|
||||
void adapterSetupFailed(const QString &error);
|
||||
|
||||
@@ -66,7 +65,7 @@ private:
|
||||
|
||||
ProjectExplorer::ApplicationLauncher *m_appLauncher;
|
||||
const QPointer<Debugger::DebuggerRunControl> m_runControl;
|
||||
BareMetalDebugSupport::State m_state;
|
||||
State m_state;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -59,6 +59,12 @@ BareMetalDevice::Ptr BareMetalDevice::create(const BareMetalDevice &other)
|
||||
return Ptr(new BareMetalDevice(other));
|
||||
}
|
||||
|
||||
BareMetalDevice::~BareMetalDevice()
|
||||
{
|
||||
if (GdbServerProvider *provider = GdbServerProviderManager::findProvider(m_gdbServerProviderId))
|
||||
provider->unregisterDevice(this);
|
||||
}
|
||||
|
||||
QString BareMetalDevice::gdbServerProviderId() const
|
||||
{
|
||||
return m_gdbServerProviderId;
|
||||
@@ -66,8 +72,26 @@ QString BareMetalDevice::gdbServerProviderId() const
|
||||
|
||||
void BareMetalDevice::setGdbServerProviderId(const QString &id)
|
||||
{
|
||||
if (id == m_gdbServerProviderId)
|
||||
return;
|
||||
if (GdbServerProvider *currentProvider = GdbServerProviderManager::findProvider(m_gdbServerProviderId))
|
||||
currentProvider->unregisterDevice(this);
|
||||
m_gdbServerProviderId = id;
|
||||
GdbServerProvider *provider = GdbServerProviderManager::instance()->findProvider(id);
|
||||
if (GdbServerProvider *provider = GdbServerProviderManager::findProvider(id)) {
|
||||
setChannelByServerProvider(provider);
|
||||
provider->registerDevice(this);
|
||||
}
|
||||
}
|
||||
|
||||
void BareMetalDevice::providerUpdated(GdbServerProvider *provider)
|
||||
{
|
||||
GdbServerProvider *myProvider = GdbServerProviderManager::findProvider(m_gdbServerProviderId);
|
||||
if (provider == myProvider)
|
||||
setChannelByServerProvider(provider);
|
||||
}
|
||||
|
||||
void BareMetalDevice::setChannelByServerProvider(GdbServerProvider *provider)
|
||||
{
|
||||
QTC_ASSERT(provider, return);
|
||||
const QString channel = provider->channel();
|
||||
const int colon = channel.indexOf(QLatin1Char(':'));
|
||||
@@ -85,8 +109,7 @@ void BareMetalDevice::fromMap(const QVariantMap &map)
|
||||
QString gdbServerProvider = map.value(QLatin1String(gdbServerProviderIdKeyC)).toString();
|
||||
if (gdbServerProvider.isEmpty()) {
|
||||
const QString name = displayName();
|
||||
if (GdbServerProvider *provider =
|
||||
GdbServerProviderManager::instance()->findByDisplayName(name)) {
|
||||
if (GdbServerProvider *provider = GdbServerProviderManager::findByDisplayName(name)) {
|
||||
gdbServerProvider = provider->id();
|
||||
} else {
|
||||
const QSsh::SshConnectionParameters sshParams = sshParameters();
|
||||
@@ -94,7 +117,7 @@ void BareMetalDevice::fromMap(const QVariantMap &map)
|
||||
newProvider->setDisplayName(name);
|
||||
newProvider->m_host = sshParams.host;
|
||||
newProvider->m_port = sshParams.port;
|
||||
if (GdbServerProviderManager::instance()->registerProvider(newProvider))
|
||||
if (GdbServerProviderManager::registerProvider(newProvider))
|
||||
gdbServerProvider = newProvider->id();
|
||||
else
|
||||
delete newProvider;
|
||||
|
@@ -31,6 +31,8 @@
|
||||
namespace BareMetal {
|
||||
namespace Internal {
|
||||
|
||||
class GdbServerProvider;
|
||||
|
||||
class BareMetalDevice : public ProjectExplorer::IDevice
|
||||
{
|
||||
public:
|
||||
@@ -42,6 +44,7 @@ public:
|
||||
Origin origin = ManuallyAdded, Core::Id id = Core::Id());
|
||||
static Ptr create(const BareMetalDevice &other);
|
||||
|
||||
~BareMetalDevice();
|
||||
QString displayType() const override;
|
||||
ProjectExplorer::IDeviceWidget *createWidget() override;
|
||||
QList<Core::Id> actionIds() const override;
|
||||
@@ -56,6 +59,7 @@ public:
|
||||
|
||||
QString gdbServerProviderId() const;
|
||||
void setGdbServerProviderId(const QString &id);
|
||||
void providerUpdated(GdbServerProvider *provider);
|
||||
|
||||
virtual void fromMap(const QVariantMap &map) override;
|
||||
virtual QVariantMap toMap() const override;
|
||||
@@ -67,6 +71,7 @@ protected:
|
||||
BareMetalDevice(const BareMetalDevice &other);
|
||||
|
||||
private:
|
||||
void setChannelByServerProvider(GdbServerProvider *provider);
|
||||
BareMetalDevice &operator=(const BareMetalDevice &);
|
||||
QString m_gdbServerProviderId;
|
||||
};
|
||||
|
@@ -42,10 +42,8 @@ public:
|
||||
explicit BareMetalDeviceConfigurationWidget(
|
||||
const ProjectExplorer::IDevice::Ptr &deviceConfig, QWidget *parent = 0);
|
||||
|
||||
private slots:
|
||||
void gdbServerProviderChanged();
|
||||
|
||||
private:
|
||||
void gdbServerProviderChanged();
|
||||
void updateDeviceFromUi();
|
||||
|
||||
GdbServerProviderChooser *m_gdbServerProviderChooser;
|
||||
|
@@ -68,8 +68,6 @@ class BareMetalGdbCommandsDeployStepWidget: public ProjectExplorer::BuildStepCon
|
||||
|
||||
public:
|
||||
explicit BareMetalGdbCommandsDeployStepWidget(BareMetalGdbCommandsDeployStep &step);
|
||||
|
||||
public slots:
|
||||
void update();
|
||||
|
||||
private:
|
||||
|
@@ -67,6 +67,7 @@ bool BareMetalPlugin::initialize(const QStringList &arguments, QString *errorStr
|
||||
addAutoReleasedObject(new BareMetalRunControlFactory);
|
||||
addAutoReleasedObject(new BareMetalRunConfigurationFactory);
|
||||
addAutoReleasedObject(new GdbServerProvidersSettingsPage);
|
||||
addAutoReleasedObject(new GdbServerProviderManager);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@@ -50,11 +50,9 @@ public:
|
||||
|
||||
Q_SLOT void runConfigurationEnabledChange();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void updateTargetInformation();
|
||||
void handleWorkingDirectoryChanged();
|
||||
|
||||
private:
|
||||
void setLabelText(QLabel &label, const QString ®ularText, const QString &errorText);
|
||||
|
||||
BareMetalRunConfigurationWidgetPrivate * const d;
|
||||
|
@@ -103,8 +103,7 @@ RunControl *BareMetalRunControlFactory::create(
|
||||
return 0;
|
||||
}
|
||||
|
||||
const GdbServerProvider *p = GdbServerProviderManager::instance()->findProvider(
|
||||
dev->gdbServerProviderId());
|
||||
const GdbServerProvider *p = GdbServerProviderManager::findProvider(dev->gdbServerProviderId());
|
||||
if (!p) {
|
||||
*errorMessage = tr("Cannot debug: Device has no GDB server provider configuration.");
|
||||
return 0;
|
||||
|
@@ -25,7 +25,9 @@
|
||||
|
||||
#include "gdbserverprovider.h"
|
||||
#include "gdbserverprovidermanager.h"
|
||||
#include "baremetaldevice.h"
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/environment.h>
|
||||
|
||||
@@ -74,6 +76,9 @@ GdbServerProvider::GdbServerProvider(const GdbServerProvider &other)
|
||||
|
||||
GdbServerProvider::~GdbServerProvider()
|
||||
{
|
||||
const QSet<BareMetalDevice *> devices = m_devices;
|
||||
for (BareMetalDevice *device : devices)
|
||||
device->setGdbServerProviderId(QString());
|
||||
}
|
||||
|
||||
QString GdbServerProvider::displayName() const
|
||||
@@ -173,9 +178,21 @@ bool GdbServerProvider::canStartupMode(StartupMode m) const
|
||||
return m == NoStartup;
|
||||
}
|
||||
|
||||
void GdbServerProvider::registerDevice(BareMetalDevice *device)
|
||||
{
|
||||
m_devices.insert(device);
|
||||
}
|
||||
|
||||
void GdbServerProvider::unregisterDevice(BareMetalDevice *device)
|
||||
{
|
||||
m_devices.remove(device);
|
||||
}
|
||||
|
||||
void GdbServerProvider::providerUpdated()
|
||||
{
|
||||
GdbServerProviderManager::instance()->notifyAboutUpdate(this);
|
||||
GdbServerProviderManager::notifyAboutUpdate(this);
|
||||
for (BareMetalDevice *device : Utils::asConst(m_devices))
|
||||
device->providerUpdated(this);
|
||||
}
|
||||
|
||||
bool GdbServerProvider::fromMap(const QVariantMap &data)
|
||||
|
@@ -26,8 +26,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QSet>
|
||||
#include <QVariantMap>
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
@@ -44,6 +44,7 @@ QT_END_NAMESPACE
|
||||
namespace BareMetal {
|
||||
namespace Internal {
|
||||
|
||||
class BareMetalDevice;
|
||||
class GdbServerProviderConfigWidget;
|
||||
class GdbServerProviderManager;
|
||||
|
||||
@@ -85,6 +86,9 @@ public:
|
||||
virtual bool isValid() const;
|
||||
virtual bool canStartupMode(StartupMode) const;
|
||||
|
||||
void registerDevice(BareMetalDevice *);
|
||||
void unregisterDevice(BareMetalDevice *);
|
||||
|
||||
protected:
|
||||
explicit GdbServerProvider(const QString &id);
|
||||
explicit GdbServerProvider(const GdbServerProvider &);
|
||||
@@ -103,6 +107,7 @@ private:
|
||||
StartupMode m_startupMode;
|
||||
QString m_initCommands;
|
||||
QString m_resetCommands;
|
||||
QSet<BareMetalDevice *> m_devices;
|
||||
|
||||
friend class GdbServerProviderConfigWidget;
|
||||
};
|
||||
@@ -145,14 +150,12 @@ public:
|
||||
signals:
|
||||
void dirty();
|
||||
|
||||
protected slots:
|
||||
void setErrorMessage(const QString &);
|
||||
void clearErrorMessage();
|
||||
|
||||
protected:
|
||||
virtual void applyImpl() = 0;
|
||||
virtual void discardImpl() = 0;
|
||||
|
||||
void setErrorMessage(const QString &);
|
||||
void clearErrorMessage();
|
||||
void addErrorLabel();
|
||||
|
||||
GdbServerProvider::StartupMode startupModeFromIndex(int idx) const;
|
||||
|
@@ -105,8 +105,7 @@ void GdbServerProviderChooser::populate()
|
||||
m_chooser->clear();
|
||||
m_chooser->addItem(tr("None"));
|
||||
|
||||
foreach (const GdbServerProvider *p,
|
||||
GdbServerProviderManager::instance()->providers()) {
|
||||
for (const GdbServerProvider *p : GdbServerProviderManager::providers()) {
|
||||
if (!providerMatches(p))
|
||||
continue;
|
||||
m_chooser->addItem(providerText(p), qVariantFromValue(p->id()));
|
||||
|
@@ -49,22 +49,17 @@ public:
|
||||
|
||||
QString currentProviderId() const;
|
||||
void setCurrentProviderId(const QString &id);
|
||||
void populate();
|
||||
|
||||
signals:
|
||||
void providerChanged();
|
||||
|
||||
public slots:
|
||||
void populate();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void currentIndexChanged(int index);
|
||||
void manageButtonClicked();
|
||||
|
||||
protected:
|
||||
bool providerMatches(const GdbServerProvider *) const;
|
||||
QString providerText(const GdbServerProvider *) const;
|
||||
|
||||
private:
|
||||
QComboBox *m_chooser;
|
||||
QPushButton *m_manageButton;
|
||||
};
|
||||
|
@@ -34,9 +34,10 @@
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <utils/persistentsettings.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/persistentsettings.h>
|
||||
|
||||
#include <QDir>
|
||||
|
||||
@@ -63,6 +64,7 @@ GdbServerProviderManager::GdbServerProviderManager(QObject *parent)
|
||||
new OpenOcdGdbServerProviderFactory,
|
||||
new StLinkUtilGdbServerProviderFactory})
|
||||
{
|
||||
m_instance = this;
|
||||
m_writer = new Utils::PersistentSettingsWriter(
|
||||
m_configFile, QLatin1String("QtCreatorGdbServerProviders"));
|
||||
|
||||
@@ -87,8 +89,6 @@ GdbServerProviderManager::~GdbServerProviderManager()
|
||||
|
||||
GdbServerProviderManager *GdbServerProviderManager::instance()
|
||||
{
|
||||
if (!m_instance)
|
||||
m_instance = new GdbServerProviderManager;
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
@@ -149,60 +149,61 @@ void GdbServerProviderManager::saveProviders()
|
||||
m_writer->save(data, Core::ICore::mainWindow());
|
||||
}
|
||||
|
||||
QList<GdbServerProvider *> GdbServerProviderManager::providers() const
|
||||
QList<GdbServerProvider *> GdbServerProviderManager::providers()
|
||||
{
|
||||
return m_providers;
|
||||
return m_instance->m_providers;
|
||||
}
|
||||
|
||||
QList<GdbServerProviderFactory *> GdbServerProviderManager::factories() const
|
||||
QList<GdbServerProviderFactory *> GdbServerProviderManager::factories()
|
||||
{
|
||||
return m_factories;
|
||||
return m_instance->m_factories;
|
||||
}
|
||||
|
||||
GdbServerProvider *GdbServerProviderManager::findProvider(const QString &id) const
|
||||
GdbServerProvider *GdbServerProviderManager::findProvider(const QString &id)
|
||||
{
|
||||
if (id.isEmpty())
|
||||
return 0;
|
||||
|
||||
return Utils::findOrDefault(m_providers, Utils::equal(&GdbServerProvider::id, id));
|
||||
return Utils::findOrDefault(m_instance->m_providers, Utils::equal(&GdbServerProvider::id, id));
|
||||
}
|
||||
|
||||
GdbServerProvider *GdbServerProviderManager::findByDisplayName(const QString &displayName) const
|
||||
GdbServerProvider *GdbServerProviderManager::findByDisplayName(const QString &displayName)
|
||||
{
|
||||
if (displayName.isEmpty())
|
||||
return 0;
|
||||
|
||||
return Utils::findOrDefault(m_providers, Utils::equal(&GdbServerProvider::displayName, displayName));
|
||||
return Utils::findOrDefault(m_instance->m_providers,
|
||||
Utils::equal(&GdbServerProvider::displayName, displayName));
|
||||
}
|
||||
|
||||
void GdbServerProviderManager::notifyAboutUpdate(GdbServerProvider *provider)
|
||||
{
|
||||
if (!provider || !m_providers.contains(provider))
|
||||
if (!provider || !m_instance->m_providers.contains(provider))
|
||||
return;
|
||||
emit providerUpdated(provider);
|
||||
emit m_instance->providerUpdated(provider);
|
||||
}
|
||||
|
||||
bool GdbServerProviderManager::registerProvider(GdbServerProvider *provider)
|
||||
{
|
||||
if (!provider || m_providers.contains(provider))
|
||||
if (!provider || m_instance->m_providers.contains(provider))
|
||||
return true;
|
||||
foreach (const GdbServerProvider *current, m_providers) {
|
||||
for (const GdbServerProvider *current : Utils::asConst(m_instance->m_providers)) {
|
||||
if (*provider == *current)
|
||||
return false;
|
||||
QTC_ASSERT(current->id() != provider->id(), return false);
|
||||
}
|
||||
|
||||
m_providers.append(provider);
|
||||
emit providerAdded(provider);
|
||||
m_instance->m_providers.append(provider);
|
||||
emit m_instance->providerAdded(provider);
|
||||
return true;
|
||||
}
|
||||
|
||||
void GdbServerProviderManager::deregisterProvider(GdbServerProvider *provider)
|
||||
{
|
||||
if (!provider || !m_providers.contains(provider))
|
||||
if (!provider || !m_instance->m_providers.contains(provider))
|
||||
return;
|
||||
m_providers.removeOne(provider);
|
||||
emit providerRemoved(provider);
|
||||
m_instance->m_providers.removeOne(provider);
|
||||
emit m_instance->providerRemoved(provider);
|
||||
delete provider;
|
||||
}
|
||||
|
||||
|
@@ -47,12 +47,12 @@ public:
|
||||
static GdbServerProviderManager *instance();
|
||||
~GdbServerProviderManager();
|
||||
|
||||
QList<GdbServerProvider *> providers() const;
|
||||
QList<GdbServerProviderFactory *> factories() const;
|
||||
GdbServerProvider *findProvider(const QString &id) const;
|
||||
GdbServerProvider *findByDisplayName(const QString &displayName) const;
|
||||
bool registerProvider(GdbServerProvider *);
|
||||
void deregisterProvider(GdbServerProvider *);
|
||||
static QList<GdbServerProvider *> providers();
|
||||
static QList<GdbServerProviderFactory *> factories();
|
||||
static GdbServerProvider *findProvider(const QString &id);
|
||||
static GdbServerProvider *findByDisplayName(const QString &displayName);
|
||||
static bool registerProvider(GdbServerProvider *);
|
||||
static void deregisterProvider(GdbServerProvider *);
|
||||
|
||||
signals:
|
||||
void providerAdded(GdbServerProvider *);
|
||||
@@ -66,7 +66,7 @@ private:
|
||||
explicit GdbServerProviderManager(QObject *parent = 0);
|
||||
|
||||
void restoreProviders();
|
||||
void notifyAboutUpdate(GdbServerProvider *);
|
||||
static void notifyAboutUpdate(GdbServerProvider *);
|
||||
|
||||
Utils::PersistentSettingsWriter *m_writer;
|
||||
QList<GdbServerProvider *> m_providers;
|
||||
|
@@ -107,7 +107,7 @@ GdbServerProviderModel::GdbServerProviderModel(QObject *parent)
|
||||
connect(manager, &GdbServerProviderManager::providerRemoved,
|
||||
this, &GdbServerProviderModel::removeProvider);
|
||||
|
||||
foreach (GdbServerProvider *p, manager->providers())
|
||||
for (GdbServerProvider *p : GdbServerProviderManager::providers())
|
||||
addProvider(p);
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ void GdbServerProviderModel::apply()
|
||||
{
|
||||
// Remove unused providers
|
||||
foreach (GdbServerProvider *provider, m_providersToRemove)
|
||||
GdbServerProviderManager::instance()->deregisterProvider(provider);
|
||||
GdbServerProviderManager::deregisterProvider(provider);
|
||||
QTC_ASSERT(m_providersToRemove.isEmpty(), m_providersToRemove.clear());
|
||||
|
||||
// Update providers
|
||||
@@ -151,7 +151,7 @@ void GdbServerProviderModel::apply()
|
||||
// Add new (and already updated) providers
|
||||
QStringList skippedProviders;
|
||||
foreach (GdbServerProvider *provider, m_providersToAdd) {
|
||||
if (!GdbServerProviderManager::instance()->registerProvider(provider))
|
||||
if (!GdbServerProviderManager::registerProvider(provider))
|
||||
skippedProviders << provider->displayName();
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ GdbServerProvidersSettingsWidget::GdbServerProvidersSettingsWidget
|
||||
// Set up add menu:
|
||||
auto addMenu = new QMenu(m_addButton);
|
||||
|
||||
foreach (const auto f, GdbServerProviderManager::instance()->factories()) {
|
||||
for (const auto f : GdbServerProviderManager::factories()) {
|
||||
auto action = new QAction(addMenu);
|
||||
action->setText(f->displayName());
|
||||
connect(action, &QAction::triggered, this, [this, f] { createProvider(f); });
|
||||
|
@@ -95,10 +95,9 @@ class OpenOcdGdbServerProviderConfigWidget : public GdbServerProviderConfigWidge
|
||||
public:
|
||||
explicit OpenOcdGdbServerProviderConfigWidget(OpenOcdGdbServerProvider *);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void startupModeChanged();
|
||||
|
||||
private:
|
||||
void applyImpl() final;
|
||||
void discardImpl() final;
|
||||
|
||||
|
@@ -101,10 +101,9 @@ class StLinkUtilGdbServerProviderConfigWidget : public GdbServerProviderConfigWi
|
||||
public:
|
||||
explicit StLinkUtilGdbServerProviderConfigWidget(StLinkUtilGdbServerProvider *);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void startupModeChanged();
|
||||
|
||||
private:
|
||||
void applyImpl() final;
|
||||
void discardImpl() final;
|
||||
|
||||
|
@@ -91,10 +91,8 @@ public:
|
||||
public:
|
||||
static ClangEditorDocumentProcessor *get(const QString &filePath);
|
||||
|
||||
private slots:
|
||||
void onParserFinished();
|
||||
|
||||
private:
|
||||
void onParserFinished();
|
||||
void updateProjectPartAndTranslationUnitForEditor();
|
||||
void registerTranslationUnitForEditor(CppTools::ProjectPart *projectPart);
|
||||
void updateTranslationUnitIfProjectPartExists();
|
||||
|
@@ -47,7 +47,6 @@ public:
|
||||
Core::Id warningConfigId() const;
|
||||
void setWarningConfigId(const Core::Id &warningConfigId);
|
||||
|
||||
public slots:
|
||||
void load();
|
||||
void store();
|
||||
|
||||
|
@@ -46,11 +46,9 @@ class ClangProjectSettingsWidget: public QWidget
|
||||
public:
|
||||
explicit ClangProjectSettingsWidget(ProjectExplorer::Project *project);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onCurrentWarningConfigChanged(const Core::Id ¤tConfigId);
|
||||
void onCustomWarningConfigsChanged(const CppTools::ClangDiagnosticConfigs &customConfigs);
|
||||
|
||||
private:
|
||||
void refreshDiagnosticConfigsWidgetFromSettings();
|
||||
void connectToCppCodeModelSettingsChanged();
|
||||
void disconnectFromCppCodeModelSettingsChanged();
|
||||
|
@@ -37,7 +37,6 @@
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
|
@@ -310,13 +310,15 @@ QString CMakeProject::displayName() const
|
||||
QStringList CMakeProject::files(FilesMode fileMode) const
|
||||
{
|
||||
QStringList result;
|
||||
rootProjectNode()->forEachNode([&](const FileNode *fn) {
|
||||
if (ProjectNode *rpn = rootProjectNode()) {
|
||||
rpn->forEachNode([&](const FileNode *fn) {
|
||||
const bool isGenerated = fn->isGenerated();
|
||||
if (fileMode == Project::SourceFiles && !isGenerated)
|
||||
result.append(fn->filePath().toString());
|
||||
if (fileMode == Project::GeneratedFiles && isGenerated)
|
||||
result.append(fn->filePath().toString());
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -68,8 +68,8 @@ public:
|
||||
public slots:
|
||||
void fileOpenRequest(const QString&);
|
||||
|
||||
private slots:
|
||||
#if defined(WITH_TESTS)
|
||||
private slots:
|
||||
void testVcsManager_data();
|
||||
void testVcsManager();
|
||||
void testSplitLineAndColumnNumber();
|
||||
|
@@ -2985,10 +2985,12 @@ bool EditorManager::restoreState(const QByteArray &state)
|
||||
void EditorManager::showEditorStatusBar(const QString &id,
|
||||
const QString &infoText,
|
||||
const QString &buttonText,
|
||||
QObject *object, const char *member)
|
||||
QObject *object,
|
||||
const std::function<void()> &function)
|
||||
{
|
||||
|
||||
EditorManagerPrivate::currentEditorView()->showEditorStatusBar(id, infoText, buttonText, object, member);
|
||||
EditorManagerPrivate::currentEditorView()->showEditorStatusBar(
|
||||
id, infoText, buttonText, object, function);
|
||||
}
|
||||
|
||||
void EditorManager::hideEditorStatusBar(const QString &id)
|
||||
|
@@ -154,7 +154,8 @@ public:
|
||||
static void showEditorStatusBar(const QString &id,
|
||||
const QString &infoText,
|
||||
const QString &buttonText = QString(),
|
||||
QObject *object = 0, const char *member = 0);
|
||||
QObject *object = nullptr,
|
||||
const std::function<void()> &function = nullptr);
|
||||
static void hideEditorStatusBar(const QString &id);
|
||||
|
||||
static EditorFactoryList editorFactories(const Utils::MimeType &mimeType, bool bestMatchOnly = true);
|
||||
|
@@ -218,15 +218,15 @@ void EditorView::closeCurrentEditor()
|
||||
void EditorView::showEditorStatusBar(const QString &id,
|
||||
const QString &infoText,
|
||||
const QString &buttonText,
|
||||
QObject *object, const char *member)
|
||||
QObject *object, const std::function<void()> &function)
|
||||
{
|
||||
m_statusWidgetId = id;
|
||||
m_statusWidgetLabel->setText(infoText);
|
||||
m_statusWidgetButton->setText(buttonText);
|
||||
m_statusWidgetButton->setToolTip(buttonText);
|
||||
m_statusWidgetButton->disconnect();
|
||||
if (object && member)
|
||||
connect(m_statusWidgetButton, SIGNAL(clicked()), object, member);
|
||||
if (object && function)
|
||||
connect(m_statusWidgetButton, &QToolButton::clicked, object, function);
|
||||
m_statusWidget->setVisible(true);
|
||||
m_statusHLine->setVisible(true);
|
||||
//m_editorForInfoWidget = currentEditor();
|
||||
|
@@ -38,6 +38,8 @@
|
||||
#include <QIcon>
|
||||
#include <QWidget>
|
||||
|
||||
#include <functional>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QAction;
|
||||
class QComboBox;
|
||||
@@ -95,7 +97,7 @@ public:
|
||||
void showEditorStatusBar(const QString &id,
|
||||
const QString &infoText,
|
||||
const QString &buttonText,
|
||||
QObject *object, const char *member);
|
||||
QObject *object, const std::function<void()> &function);
|
||||
void hideEditorStatusBar(const QString &id);
|
||||
void setCloseSplitEnabled(bool enable);
|
||||
void setCloseSplitIcon(const QIcon &icon);
|
||||
|
@@ -46,14 +46,12 @@ public:
|
||||
explicit FormClassWizardDialog(const Core::BaseFileWizardFactory *factory, QWidget *parent = 0);
|
||||
|
||||
QString path() const;
|
||||
void setPath(const QString &);
|
||||
|
||||
Designer::FormClassWizardParameters parameters() const;
|
||||
|
||||
bool validateCurrentPage();
|
||||
|
||||
public slots:
|
||||
void setPath(const QString &);
|
||||
|
||||
protected:
|
||||
void initializePage(int id);
|
||||
|
||||
|
@@ -48,6 +48,8 @@ public:
|
||||
virtual bool isComplete () const;
|
||||
virtual bool validatePage();
|
||||
|
||||
void setClassName(const QString &suggestedClassName);
|
||||
void setPath(const QString &);
|
||||
QString path() const;
|
||||
|
||||
// Fill out applicable parameters
|
||||
@@ -58,11 +60,7 @@ public:
|
||||
|
||||
static bool lowercaseHeaderFiles();
|
||||
|
||||
public slots:
|
||||
void setClassName(const QString &suggestedClassName);
|
||||
void setPath(const QString &);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void slotValidChanged();
|
||||
|
||||
private:
|
||||
|
@@ -63,8 +63,6 @@ public:
|
||||
SharedTools::WidgetHost *formWindowEditorForFormWindow(const QDesignerFormWindowInterface *fw) const;
|
||||
|
||||
EditorData activeEditor() const;
|
||||
|
||||
public slots:
|
||||
void resetToDefaultLayout();
|
||||
|
||||
private:
|
||||
|
@@ -47,14 +47,14 @@ public:
|
||||
bool initialize(const QStringList &arguments, QString *errorMessage = 0) override;
|
||||
void extensionsInitialized() override;
|
||||
|
||||
private slots:
|
||||
#ifdef WITH_TESTS
|
||||
private slots:
|
||||
void test_gotoslot();
|
||||
void test_gotoslot_data();
|
||||
#endif
|
||||
void switchSourceForm();
|
||||
|
||||
private:
|
||||
void switchSourceForm();
|
||||
void initializeTemplates();
|
||||
|
||||
QAction *m_actionSwitchSource;
|
||||
|
@@ -62,15 +62,13 @@ public:
|
||||
|
||||
EditorData activeEditor() const;
|
||||
|
||||
public slots:
|
||||
void removeFormWindowEditor(QObject *);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void updateFormWindowSelectionHandles();
|
||||
void modeAboutToChange(Core::Id mode);
|
||||
void formSizeChanged(int w, int h);
|
||||
|
||||
private:
|
||||
inline int indexOfFormWindow(const QDesignerFormWindowInterface *) const;
|
||||
inline int indexOfFormEditor(const QObject *xmlEditor) const;
|
||||
|
||||
|
@@ -68,10 +68,9 @@ public:
|
||||
signals:
|
||||
void templateActivated();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void slotCurrentTemplateChanged(bool);
|
||||
|
||||
private:
|
||||
QString m_templateContents;
|
||||
QDesignerNewFormWidgetInterface *m_newFormWidget;
|
||||
bool m_templateSelected;
|
||||
|
@@ -69,15 +69,13 @@ public:
|
||||
QString formWindowContents() const;
|
||||
ResourceHandler *resourceHandler() const;
|
||||
|
||||
public slots:
|
||||
void setFilePath(const Utils::FileName &) override;
|
||||
void setShouldAutoSave(bool sad = true) { m_shouldAutoSave = sad; }
|
||||
void updateIsModified();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void slotFormWindowRemoved(QDesignerFormWindowInterface *w);
|
||||
|
||||
private:
|
||||
QString m_suggestedName;
|
||||
bool m_shouldAutoSave = false;
|
||||
// Might actually go out of scope before the IEditor due
|
||||
|
@@ -44,18 +44,16 @@ public:
|
||||
|
||||
bool supportsToSlotNavigation() { return true; }
|
||||
|
||||
void updateSelection() override;
|
||||
|
||||
signals:
|
||||
void creatorHelpRequested(const QUrl &url);
|
||||
|
||||
public slots:
|
||||
void updateSelection() override;
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void slotNavigateToSlot(const QString &objectName, const QString &signalSignature, const QStringList ¶meterNames);
|
||||
void slotDesignerHelpRequested(const QString &manual, const QString &document);
|
||||
void slotSyncSettingsToDesigner();
|
||||
|
||||
private:
|
||||
bool navigateToSlot(const QString &objectName,
|
||||
const QString &signalSignature,
|
||||
const QStringList ¶meterNames,
|
||||
|
@@ -52,7 +52,6 @@ public:
|
||||
explicit ResourceHandler(QDesignerFormWindowInterface *fw);
|
||||
virtual ~ResourceHandler();
|
||||
|
||||
public slots:
|
||||
void updateResources() { updateResourcesHelper(false); }
|
||||
void updateProjectResources() { updateResourcesHelper(true); }
|
||||
|
||||
|
@@ -59,7 +59,6 @@ public:
|
||||
const QString &displayName);
|
||||
static DiffEditorController *controller(Core::IDocument *document);
|
||||
|
||||
public slots:
|
||||
void informationForCommitReceived(const QString &output);
|
||||
|
||||
signals:
|
||||
|
@@ -77,6 +77,8 @@ public:
|
||||
OpenResult open(QString *errorString, const QString &fileName,
|
||||
const QString &realFileName) override;
|
||||
bool isReloading() const { return m_isReloading; }
|
||||
void beginReload();
|
||||
void endReload(bool success);
|
||||
|
||||
QString plainText() const;
|
||||
|
||||
@@ -87,10 +89,6 @@ signals:
|
||||
void chunkActionsRequested(QMenu *menu, int diffFileIndex, int chunkIndex);
|
||||
void requestMoreInformation();
|
||||
|
||||
public slots:
|
||||
void beginReload();
|
||||
void endReload(bool success);
|
||||
|
||||
private:
|
||||
void setController(DiffEditorController *controller);
|
||||
|
||||
|
@@ -56,22 +56,23 @@ public:
|
||||
bool initialize(const QStringList &arguments, QString *errorMessage = 0);
|
||||
void extensionsInitialized();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void updateDiffCurrentFileAction();
|
||||
void updateDiffOpenFilesAction();
|
||||
void diffCurrentFile();
|
||||
void diffOpenFiles();
|
||||
void diffExternalFiles();
|
||||
|
||||
QAction *m_diffCurrentFileAction = nullptr;
|
||||
QAction *m_diffOpenFilesAction = nullptr;
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
private slots:
|
||||
void testMakePatch_data();
|
||||
void testMakePatch();
|
||||
void testReadPatch_data();
|
||||
void testReadPatch();
|
||||
#endif // WITH_TESTS
|
||||
private:
|
||||
QAction *m_diffCurrentFileAction = nullptr;
|
||||
QAction *m_diffOpenFilesAction = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -87,7 +87,6 @@ public:
|
||||
void saveState();
|
||||
void restoreState();
|
||||
|
||||
public slots:
|
||||
void setDisplaySettings(const DisplaySettings &ds) override;
|
||||
|
||||
signals:
|
||||
@@ -534,8 +533,8 @@ SideBySideDiffEditorWidget::SideBySideDiffEditorWidget(QWidget *parent)
|
||||
|
||||
connect(m_leftEditor, &QPlainTextEdit::cursorPositionChanged,
|
||||
this, &SideBySideDiffEditorWidget::leftCursorPositionChanged);
|
||||
// connect(m_leftEditor->document()->documentLayout(), SIGNAL(documentSizeChanged(QSizeF)),
|
||||
// this, SLOT(leftDocumentSizeChanged()));
|
||||
// connect(m_leftEditor->document()->documentLayout(), &QAbstractTextDocumentLayout::documentSizeChanged,
|
||||
// this, &SideBySideDiffEditorWidget::leftDocumentSizeChanged);
|
||||
|
||||
connect(m_rightEditor->verticalScrollBar(), &QAbstractSlider::valueChanged,
|
||||
this, &SideBySideDiffEditorWidget::rightVSliderChanged);
|
||||
|
@@ -70,7 +70,7 @@ public:
|
||||
signals:
|
||||
void currentDiffFileIndexChanged(int index);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void setFontSettings(const TextEditor::FontSettings &fontSettings);
|
||||
void slotLeftJumpToOriginalFileRequested(int diffFileIndex,
|
||||
int lineNumber, int columnNumber);
|
||||
@@ -87,7 +87,6 @@ private slots:
|
||||
void leftCursorPositionChanged();
|
||||
void rightCursorPositionChanged();
|
||||
|
||||
private:
|
||||
void showDiff();
|
||||
|
||||
SideDiffEditorWidget *m_leftEditor;
|
||||
|
@@ -64,25 +64,22 @@ public:
|
||||
void restoreState();
|
||||
|
||||
void clear(const QString &message = QString());
|
||||
void setDisplaySettings(const TextEditor::DisplaySettings &ds) override;
|
||||
|
||||
signals:
|
||||
void currentDiffFileIndexChanged(int index);
|
||||
|
||||
public slots:
|
||||
void setDisplaySettings(const TextEditor::DisplaySettings &ds) override;
|
||||
|
||||
protected:
|
||||
void mouseDoubleClickEvent(QMouseEvent *e) override;
|
||||
void contextMenuEvent(QContextMenuEvent *e) override;
|
||||
QString lineNumber(int blockNumber) const override;
|
||||
int lineNumberDigits() const override;
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void setFontSettings(const TextEditor::FontSettings &fontSettings);
|
||||
|
||||
void slotCursorPositionChangedInEditor();
|
||||
|
||||
private:
|
||||
void setLeftLineNumber(int blockNumber, int lineNumber);
|
||||
void setRightLineNumber(int blockNumber, int lineNumber);
|
||||
void setFileInfo(int blockNumber,
|
||||
|
@@ -49,12 +49,11 @@ public:
|
||||
|
||||
void accept() override;
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void resetExportSize();
|
||||
void exportWidthChanged(int width);
|
||||
void exportHeightChanged(int height);
|
||||
|
||||
private:
|
||||
void setExportWidthBlocked(int width);
|
||||
void setExportHeightBlocked(int height);
|
||||
|
||||
|
@@ -68,11 +68,6 @@ public:
|
||||
void reset();
|
||||
void createScene();
|
||||
|
||||
signals:
|
||||
void scaleFactorChanged(qreal factor);
|
||||
void imageSizeChanged(const QSize &size);
|
||||
|
||||
public slots:
|
||||
void exportImage();
|
||||
void setViewBackground(bool enable);
|
||||
void setViewOutline(bool enable);
|
||||
@@ -81,18 +76,19 @@ public slots:
|
||||
void resetToOriginalSize();
|
||||
void fitToScreen();
|
||||
|
||||
private slots:
|
||||
void emitScaleFactor();
|
||||
signals:
|
||||
void scaleFactorChanged(qreal factor);
|
||||
void imageSizeChanged(const QSize &size);
|
||||
|
||||
private:
|
||||
void emitScaleFactor();
|
||||
void doScale(qreal factor);
|
||||
|
||||
protected:
|
||||
void drawBackground(QPainter *p, const QRectF &rect);
|
||||
void hideEvent(QHideEvent *event);
|
||||
void showEvent(QShowEvent *event);
|
||||
void wheelEvent(QWheelEvent *event);
|
||||
|
||||
private:
|
||||
void doScale(qreal factor);
|
||||
|
||||
ImageViewerFile *m_file;
|
||||
QGraphicsItem *m_imageItem = 0;
|
||||
QGraphicsRectItem *m_backgroundItem = 0;
|
||||
|
@@ -54,7 +54,6 @@ public:
|
||||
|
||||
IEditor *duplicate() override;
|
||||
|
||||
public slots:
|
||||
void exportImage();
|
||||
void imageSizeUpdated(const QSize &size);
|
||||
void scaleFactorUpdate(qreal factor);
|
||||
@@ -68,12 +67,10 @@ public slots:
|
||||
void updateToolButtons();
|
||||
void togglePlay();
|
||||
|
||||
private slots:
|
||||
void playToggled();
|
||||
|
||||
private:
|
||||
ImageViewer(const QSharedPointer<ImageViewerFile> &document, QWidget *parent = 0);
|
||||
void ctor();
|
||||
void playToggled();
|
||||
void updatePauseAction();
|
||||
|
||||
struct ImageViewerPrivate *d;
|
||||
|
@@ -287,10 +287,9 @@ void MacroManager::startMacro()
|
||||
QString executeShortcut = Core::ActionManager::command(Constants::EXECUTE_LAST_MACRO)->keySequence().toString();
|
||||
QString help = tr("Macro mode. Type \"%1\" to stop recording and \"%2\" to play the macro.")
|
||||
.arg(endShortcut).arg(executeShortcut);
|
||||
Core::EditorManager::showEditorStatusBar(
|
||||
QLatin1String(Constants::M_STATUS_BUFFER),
|
||||
help,
|
||||
tr("Stop Recording Macro"), this, SLOT(endMacro()));
|
||||
Core::EditorManager::showEditorStatusBar(Constants::M_STATUS_BUFFER, help,
|
||||
tr("Stop Recording Macro"),
|
||||
this, [this] { endMacro(); });
|
||||
}
|
||||
|
||||
void MacroManager::endMacro()
|
||||
|
@@ -56,8 +56,6 @@ public:
|
||||
void executeLastMacro();
|
||||
void saveLastMacro();
|
||||
bool executeMacro(const QString &name);
|
||||
|
||||
public slots:
|
||||
void endMacro();
|
||||
|
||||
protected:
|
||||
|
@@ -67,7 +67,6 @@ public:
|
||||
|
||||
bool sccManaged(const QString &filename);
|
||||
|
||||
public slots:
|
||||
// To be connected to the HgTask's success signal to emit the repository/
|
||||
// files changed signals according to the variant's type:
|
||||
// String -> repository, StringList -> files
|
||||
|
@@ -126,7 +126,8 @@ bool MercurialPlugin::initialize(const QStringList & /* arguments */, QString *
|
||||
|
||||
addAutoReleasedObject(new OptionsPage(versionControl()));
|
||||
|
||||
connect(m_client, SIGNAL(changed(QVariant)), versionControl(), SLOT(changed(QVariant)));
|
||||
connect(m_client, &VcsBaseClient::changed,
|
||||
static_cast<MercurialControl *>(versionControl()), &MercurialControl::changed);
|
||||
connect(m_client, &MercurialClient::needUpdate, this, &MercurialPlugin::update);
|
||||
|
||||
const auto describeFunc = [this](const QString &source, const QString &id) {
|
||||
@@ -164,7 +165,6 @@ void MercurialPlugin::createMenu(const Core::Context &context)
|
||||
m_mercurialContainer->addSeparator(context);
|
||||
createRepositoryActions(context);
|
||||
m_mercurialContainer->addSeparator(context);
|
||||
createRepositoryManagementActions(context);
|
||||
|
||||
// Request the Tools menu and add the Mercurial menu to it
|
||||
Core::ActionContainer *toolsMenu = Core::ActionManager::actionContainer(Core::Id(Core::Constants::M_TOOLS));
|
||||
@@ -603,18 +603,6 @@ bool MercurialPlugin::submitEditorAboutToClose()
|
||||
return true;
|
||||
}
|
||||
|
||||
void MercurialPlugin::createRepositoryManagementActions(const Core::Context &context)
|
||||
{
|
||||
//TODO create menu for these options
|
||||
Q_UNUSED(context);
|
||||
return;
|
||||
// auto action = new QAction(tr("Branch"), this);
|
||||
// actionList.append(action);
|
||||
// Core::Command *command = Core::ActionManager::registerAction(action, Constants::BRANCH, context);
|
||||
// // connect(action, SIGNAL(triggered()), this, SLOT(branch()));
|
||||
// m_mercurialContainer->addAction(command);
|
||||
}
|
||||
|
||||
void MercurialPlugin::updateActions(VcsBasePlugin::ActionState as)
|
||||
{
|
||||
if (!enableMenuAction(as, m_menuAction)) {
|
||||
|
@@ -127,7 +127,6 @@ private:
|
||||
void createFileActions(const Core::Context &context);
|
||||
void createDirectoryActions(const Core::Context &context);
|
||||
void createRepositoryActions(const Core::Context &context);
|
||||
void createRepositoryManagementActions(const Core::Context &context);
|
||||
|
||||
// Variables
|
||||
static MercurialPlugin *m_instance;
|
||||
|
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
void createActions();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void undo();
|
||||
void redo();
|
||||
void cut();
|
||||
@@ -88,7 +88,6 @@ private slots:
|
||||
void zoomOut();
|
||||
void resetZoom();
|
||||
|
||||
private:
|
||||
Core::Command *registerCommand(const Core::Id &id, const std::function<void()> &slot,
|
||||
const Core::Context &context,
|
||||
bool scriptable = true, const QString &title = QString(),
|
||||
|
@@ -46,7 +46,7 @@ public:
|
||||
ElementTasks *elementTasks() const;
|
||||
PxNodeController *pxNodeController() const;
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onProjectFileNameChanged(const QString &fileName);
|
||||
|
||||
private:
|
||||
|
@@ -65,7 +65,7 @@ public:
|
||||
QString findModel(const qmt::Uid &modelUid);
|
||||
QString findDiagram(const qmt::Uid &modelUid, const qmt::Uid &diagramUid);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onProjectAdded(ProjectExplorer::Project *project);
|
||||
void onAboutToRemoveProject(ProjectExplorer::Project *project);
|
||||
void onProjectFileListChanged(ProjectExplorer::Project *project);
|
||||
|
@@ -60,12 +60,11 @@ public:
|
||||
void releaseModel(ExtDocumentController *documentController);
|
||||
void openDiagram(const qmt::Uid &modelUid, const qmt::Uid &diagramUid);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onAboutToShowContextMenu(ProjectExplorer::Project *project, ProjectExplorer::Node *node);
|
||||
void onOpenDiagramFromProjectExplorer();
|
||||
void onOpenDefaultModel(const qmt::Uid &modelUid);
|
||||
|
||||
private:
|
||||
void openDiagram(ExtDocumentController *documentController, qmt::MDiagram *diagram);
|
||||
|
||||
private:
|
||||
|
@@ -54,7 +54,6 @@ public:
|
||||
bool hasRightHorizSplitterState() const;
|
||||
QByteArray rightHorizSplitterState() const;
|
||||
|
||||
public slots:
|
||||
void onRightSplitterChanged(const QByteArray &state);
|
||||
void onRightHorizSplitterChanged(const QByteArray &state);
|
||||
void saveSettings(QSettings *settings);
|
||||
|
@@ -57,21 +57,6 @@ QList<ProjectAction> NimProjectNode::supportedActions(Node *node) const
|
||||
}
|
||||
}
|
||||
|
||||
bool NimProjectNode::addSubProjects(const QStringList &)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool NimProjectNode::canAddSubProject(const QString &) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool NimProjectNode::removeSubProjects(const QStringList &)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool NimProjectNode::addFiles(const QStringList &filePaths, QStringList *)
|
||||
{
|
||||
return m_project.addFiles(filePaths);
|
||||
|
@@ -39,9 +39,6 @@ public:
|
||||
NimProjectNode(NimProject &project, const Utils::FileName &projectFilePath);
|
||||
|
||||
QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const override;
|
||||
bool canAddSubProject(const QString &) const override;
|
||||
bool addSubProjects(const QStringList &) override;
|
||||
bool removeSubProjects(const QStringList &) override;
|
||||
bool addFiles(const QStringList &filePaths, QStringList *) override;
|
||||
bool removeFiles(const QStringList &filePaths, QStringList *) override;
|
||||
bool deleteFiles(const QStringList &) override;
|
||||
|
@@ -993,17 +993,23 @@ PerforceResponse PerforcePlugin::synchronousProcess(const QString &workingDir,
|
||||
// connect stderr to the output window if desired
|
||||
if (flags & StdErrToWindow) {
|
||||
process.setStdErrBufferedSignalsEnabled(true);
|
||||
connect(&process, SIGNAL(stdErrBuffered(QString,bool)), outputWindow, SLOT(append(QString)));
|
||||
connect(&process, &SynchronousProcess::stdErrBuffered,
|
||||
outputWindow, [outputWindow](const QString &lines) {
|
||||
outputWindow->append(lines);
|
||||
});
|
||||
}
|
||||
|
||||
// connect stdout to the output window if desired
|
||||
if (flags & StdOutToWindow) {
|
||||
process.setStdOutBufferedSignalsEnabled(true);
|
||||
if (flags & SilentStdOut) {
|
||||
connect(&process, &SynchronousProcess::stdOutBuffered, outputWindow, &VcsOutputWindow::appendSilently);
|
||||
}
|
||||
else {
|
||||
connect(&process, SIGNAL(stdOutBuffered(QString,bool)), outputWindow, SLOT(append(QString)));
|
||||
connect(&process, &SynchronousProcess::stdOutBuffered,
|
||||
outputWindow, &VcsOutputWindow::appendSilently);
|
||||
} else {
|
||||
connect(&process, &SynchronousProcess::stdOutBuffered,
|
||||
outputWindow, [outputWindow](const QString &lines) {
|
||||
outputWindow->append(lines);
|
||||
});
|
||||
}
|
||||
}
|
||||
process.setTimeOutMessageBoxEnabled(true);
|
||||
|
@@ -85,6 +85,7 @@ static void replaceAllChildWidgets(QLayout *layout, const QList<QWidget *> &newC
|
||||
|
||||
namespace {
|
||||
const char SETTINGS_KEY[] = "ProjectExplorer/AppOutput/Zoom";
|
||||
const char C_APP_OUTPUT[] = "ProjectExplorer.ApplicationOutput";
|
||||
}
|
||||
|
||||
namespace ProjectExplorer {
|
||||
@@ -425,7 +426,7 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc)
|
||||
}
|
||||
// Create new
|
||||
static int counter = 0;
|
||||
Core::Id contextId = Core::Id(Constants::C_APP_OUTPUT).withSuffix(counter++);
|
||||
Core::Id contextId = Core::Id(C_APP_OUTPUT).withSuffix(counter++);
|
||||
Core::Context context(contextId);
|
||||
Core::OutputWindow *ow = new Core::OutputWindow(context, m_tabWidget);
|
||||
ow->setWindowTitle(tr("Application Output Window"));
|
||||
|
@@ -57,6 +57,7 @@ using namespace ProjectExplorer::Internal;
|
||||
namespace {
|
||||
const int MAX_LINECOUNT = 100000;
|
||||
const char SETTINGS_KEY[] = "ProjectExplorer/CompileOutput/Zoom";
|
||||
const char C_COMPILE_OUTPUT[] = "ProjectExplorer.CompileOutput";
|
||||
}
|
||||
|
||||
namespace ProjectExplorer {
|
||||
@@ -148,7 +149,7 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) :
|
||||
m_zoomOutButton(new QToolButton),
|
||||
m_escapeCodeHandler(new Utils::AnsiEscapeCodeHandler)
|
||||
{
|
||||
Core::Context context(Constants::C_COMPILE_OUTPUT);
|
||||
Core::Context context(C_COMPILE_OUTPUT);
|
||||
m_outputWindow = new CompileOutputTextEdit(context);
|
||||
m_outputWindow->setWindowTitle(displayName());
|
||||
m_outputWindow->setWindowIcon(Icons::WINDOW.icon());
|
||||
|
@@ -34,10 +34,11 @@
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
namespace ProjectExplorer {
|
||||
|
||||
const char BUILD_STEP_LIST_COUNT[] = "ProjectExplorer.BuildConfiguration.BuildStepListCount";
|
||||
const char BUILD_STEP_LIST_PREFIX[] = "ProjectExplorer.BuildConfiguration.BuildStepList.";
|
||||
const char DEFAULT_DEPLOYCONFIGURATION_ID[] = "ProjectExplorer.DefaultDeployConfiguration";
|
||||
|
||||
DeployConfiguration::DeployConfiguration(Target *target, Core::Id id) :
|
||||
ProjectConfiguration(target, id)
|
||||
@@ -204,12 +205,12 @@ QList<Core::Id> DefaultDeployConfigurationFactory::availableCreationIds(Target *
|
||||
{
|
||||
if (!canHandle(parent))
|
||||
return QList<Core::Id>();
|
||||
return QList<Core::Id>() << Core::Id(Constants::DEFAULT_DEPLOYCONFIGURATION_ID);
|
||||
return QList<Core::Id>() << Core::Id(DEFAULT_DEPLOYCONFIGURATION_ID);
|
||||
}
|
||||
|
||||
QString DefaultDeployConfigurationFactory::displayNameForId(Core::Id id) const
|
||||
{
|
||||
if (id == Constants::DEFAULT_DEPLOYCONFIGURATION_ID)
|
||||
if (id == DEFAULT_DEPLOYCONFIGURATION_ID)
|
||||
//: Display name of the default deploy configuration
|
||||
return DeployConfigurationFactory::tr("Deploy Configuration");
|
||||
return QString();
|
||||
@@ -219,7 +220,7 @@ bool DefaultDeployConfigurationFactory::canCreate(Target *parent, Core::Id id) c
|
||||
{
|
||||
if (!canHandle(parent))
|
||||
return false;
|
||||
return id == Constants::DEFAULT_DEPLOYCONFIGURATION_ID;
|
||||
return id == DEFAULT_DEPLOYCONFIGURATION_ID;
|
||||
}
|
||||
|
||||
DeployConfiguration *DefaultDeployConfigurationFactory::create(Target *parent, Core::Id id)
|
||||
@@ -264,3 +265,5 @@ bool DefaultDeployConfigurationFactory::canHandle(Target *parent) const
|
||||
return false;
|
||||
return DeviceTypeKitInformation::deviceTypeId(parent->kit()) == Constants::DESKTOP_DEVICE_TYPE;
|
||||
}
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
@@ -148,13 +148,14 @@ void DeviceManager::load()
|
||||
|
||||
Utils::PersistentSettingsReader reader;
|
||||
// read devices file from global settings path
|
||||
QHash<Core::Id, Core::Id> defaultDevices;
|
||||
QList<IDevice::Ptr> sdkDevices;
|
||||
if (reader.load(systemSettingsFilePath(QLatin1String("/qtcreator/devices.xml"))))
|
||||
sdkDevices = fromMap(reader.restoreValues().value(QLatin1String(DeviceManagerKey)).toMap());
|
||||
sdkDevices = fromMap(reader.restoreValues().value(DeviceManagerKey).toMap(), &defaultDevices);
|
||||
// read devices file from user settings path
|
||||
QList<IDevice::Ptr> userDevices;
|
||||
if (reader.load(settingsFilePath(QLatin1String("/devices.xml"))))
|
||||
userDevices = fromMap(reader.restoreValues().value(QLatin1String(DeviceManagerKey)).toMap());
|
||||
userDevices = fromMap(reader.restoreValues().value(DeviceManagerKey).toMap(), &defaultDevices);
|
||||
// Insert devices into the model. Prefer the higher device version when there are multiple
|
||||
// devices with the same id.
|
||||
foreach (IDevice::Ptr device, userDevices) {
|
||||
@@ -172,18 +173,25 @@ void DeviceManager::load()
|
||||
foreach (const IDevice::Ptr &sdkDevice, sdkDevices)
|
||||
addDevice(sdkDevice);
|
||||
|
||||
ensureOneDefaultDevicePerType();
|
||||
// Overwrite with the saved default devices.
|
||||
for (auto itr = defaultDevices.constBegin(); itr != defaultDevices.constEnd(); ++itr) {
|
||||
IDevice::ConstPtr device = find(itr.value());
|
||||
if (device)
|
||||
d->defaultDevices[device->type()] = device->id();
|
||||
}
|
||||
|
||||
emit devicesLoaded();
|
||||
}
|
||||
|
||||
QList<IDevice::Ptr> DeviceManager::fromMap(const QVariantMap &map)
|
||||
QList<IDevice::Ptr> DeviceManager::fromMap(const QVariantMap &map,
|
||||
QHash<Core::Id, Core::Id> *defaultDevices)
|
||||
{
|
||||
QList<IDevice::Ptr> devices;
|
||||
const QVariantMap defaultDevsMap = map.value(QLatin1String(DefaultDevicesKey)).toMap();
|
||||
for (QVariantMap::ConstIterator it = defaultDevsMap.constBegin();
|
||||
it != defaultDevsMap.constEnd(); ++it) {
|
||||
d->defaultDevices.insert(Core::Id::fromString(it.key()), Core::Id::fromSetting(it.value()));
|
||||
|
||||
if (defaultDevices) {
|
||||
const QVariantMap defaultDevsMap = map.value(DefaultDevicesKey).toMap();
|
||||
for (auto it = defaultDevsMap.constBegin(); it != defaultDevsMap.constEnd(); ++it)
|
||||
defaultDevices->insert(Core::Id::fromString(it.key()), Core::Id::fromSetting(it.value()));
|
||||
}
|
||||
const QVariantList deviceList = map.value(QLatin1String(DeviceListKey)).toList();
|
||||
foreach (const QVariant &v, deviceList) {
|
||||
@@ -398,14 +406,6 @@ IDevice::ConstPtr DeviceManager::defaultDevice(Core::Id deviceType) const
|
||||
return id.isValid() ? find(id) : IDevice::ConstPtr();
|
||||
}
|
||||
|
||||
void DeviceManager::ensureOneDefaultDevicePerType()
|
||||
{
|
||||
foreach (const IDevice::Ptr &device, d->devices) {
|
||||
if (!defaultDevice(device->type()))
|
||||
d->defaultDevices.insert(device->type(), device->id());
|
||||
}
|
||||
}
|
||||
|
||||
QString DeviceManager::hostKeysFilePath()
|
||||
{
|
||||
return settingsFilePath(QLatin1String("/ssh-hostkeys")).toString();
|
||||
|
@@ -85,9 +85,8 @@ private:
|
||||
|
||||
void load();
|
||||
static const IDeviceFactory *restoreFactory(const QVariantMap &map);
|
||||
QList<IDevice::Ptr> fromMap(const QVariantMap &map);
|
||||
QList<IDevice::Ptr> fromMap(const QVariantMap &map, QHash<Core::Id, Core::Id> *defaultDevices);
|
||||
QVariantMap toMap() const;
|
||||
void ensureOneDefaultDevicePerType();
|
||||
|
||||
// For SettingsWidget.
|
||||
IDevice::Ptr mutableDevice(Core::Id id) const;
|
||||
|
@@ -175,7 +175,7 @@ void JsonSummaryPage::addToProject(const JsonWizard::GeneratorFiles &files)
|
||||
if (!folder)
|
||||
return;
|
||||
if (kind == IWizardFactory::ProjectWizard) {
|
||||
if (!static_cast<ProjectNode *>(folder)->addSubProjects(QStringList(generatedProject))) {
|
||||
if (!static_cast<ProjectNode *>(folder)->addSubProject(generatedProject)) {
|
||||
QMessageBox::critical(m_wizard, tr("Failed to Add to Project"),
|
||||
tr("Failed to add subproject \"%1\"\nto project \"%2\".")
|
||||
.arg(QDir::toNativeSeparators(generatedProject))
|
||||
|
@@ -583,18 +583,24 @@ QString Kit::toHtml(const QList<Task> &additional) const
|
||||
|
||||
void Kit::setAutoDetected(bool detected)
|
||||
{
|
||||
if (d->m_autodetected == detected)
|
||||
return;
|
||||
d->m_autodetected = detected;
|
||||
kitUpdated();
|
||||
}
|
||||
|
||||
void Kit::setAutoDetectionSource(const QString &autoDetectionSource)
|
||||
{
|
||||
if (d->m_autoDetectionSource == autoDetectionSource)
|
||||
return;
|
||||
d->m_autoDetectionSource = autoDetectionSource;
|
||||
kitUpdated();
|
||||
}
|
||||
|
||||
void Kit::setSdkProvided(bool sdkProvided)
|
||||
{
|
||||
if (d->m_sdkProvided == sdkProvided)
|
||||
return;
|
||||
d->m_sdkProvided = sdkProvided;
|
||||
kitUpdated();
|
||||
}
|
||||
@@ -609,6 +615,9 @@ void Kit::makeSticky()
|
||||
|
||||
void Kit::setSticky(Id id, bool b)
|
||||
{
|
||||
if (d->m_sticky.contains(id) == b)
|
||||
return;
|
||||
|
||||
if (b)
|
||||
d->m_sticky.insert(id);
|
||||
else
|
||||
@@ -618,12 +627,17 @@ void Kit::setSticky(Id id, bool b)
|
||||
|
||||
void Kit::makeUnSticky()
|
||||
{
|
||||
if (d->m_sticky.isEmpty())
|
||||
return;
|
||||
d->m_sticky.clear();
|
||||
kitUpdated();
|
||||
}
|
||||
|
||||
void Kit::setMutable(Id id, bool b)
|
||||
{
|
||||
if (d->m_mutable.contains(id) == b)
|
||||
return;
|
||||
|
||||
if (b)
|
||||
d->m_mutable.insert(id);
|
||||
else
|
||||
|
@@ -46,6 +46,10 @@
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
const char KITINFORMATION_ID_V1[] = "PE.Profile.ToolChain";
|
||||
const char KITINFORMATION_ID_V2[] = "PE.Profile.ToolChains";
|
||||
const char KITINFORMATION_ID_V3[] = "PE.Profile.ToolChainsV3";
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// SysRootKitInformation:
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -195,8 +199,8 @@ QList<Task> ToolChainKitInformation::validate(const Kit *k) const
|
||||
|
||||
void ToolChainKitInformation::upgrade(Kit *k)
|
||||
{
|
||||
const Core::Id oldIdV1 = Constants::KITINFORMATION_ID_V1;
|
||||
const Core::Id oldIdV2 = Constants::KITINFORMATION_ID_V2;
|
||||
const Core::Id oldIdV1 = KITINFORMATION_ID_V1;
|
||||
const Core::Id oldIdV2 = KITINFORMATION_ID_V2;
|
||||
|
||||
// upgrade <=4.1 to 4.2 (keep old settings around for now)
|
||||
{
|
||||
@@ -373,7 +377,7 @@ QSet<Core::Id> ToolChainKitInformation::availableFeatures(const Kit *k) const
|
||||
|
||||
Core::Id ToolChainKitInformation::id()
|
||||
{
|
||||
return Constants::KITINFORMATION_ID_V3;
|
||||
return KITINFORMATION_ID_V3;
|
||||
}
|
||||
|
||||
ToolChain *ToolChainKitInformation::toolChain(const Kit *k, Core::Id language)
|
||||
|
@@ -30,7 +30,6 @@
|
||||
#include "kitfeatureprovider.h"
|
||||
#include "kitmanagerconfigwidget.h"
|
||||
#include "project.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "task.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
@@ -417,13 +417,6 @@ void Project::setDocument(Core::IDocument *doc)
|
||||
QTC_ASSERT(doc, return);
|
||||
QTC_ASSERT(!d->m_document, return);
|
||||
d->m_document = doc;
|
||||
|
||||
if (!d->m_rootProjectNode) {
|
||||
auto newRoot = new ProjectNode(projectDirectory());
|
||||
newRoot->setDisplayName(displayName());
|
||||
newRoot->addNode(new FileNode(projectFilePath(), FileType::Project, false));
|
||||
setRootProjectNode(newRoot);
|
||||
}
|
||||
}
|
||||
|
||||
void Project::setRootProjectNode(ProjectNode *root)
|
||||
|
@@ -166,6 +166,77 @@ using namespace ProjectExplorer::Internal;
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
namespace Constants {
|
||||
const int P_MODE_SESSION = 85;
|
||||
|
||||
// Actions
|
||||
const char NEWSESSION[] = "ProjectExplorer.NewSession";
|
||||
const char NEWPROJECT[] = "ProjectExplorer.NewProject";
|
||||
const char LOAD[] = "ProjectExplorer.Load";
|
||||
const char UNLOAD[] = "ProjectExplorer.Unload";
|
||||
const char UNLOADCM[] = "ProjectExplorer.UnloadCM";
|
||||
const char CLEARSESSION[] = "ProjectExplorer.ClearSession";
|
||||
const char BUILDPROJECTONLY[] = "ProjectExplorer.BuildProjectOnly";
|
||||
const char BUILDCM[] = "ProjectExplorer.BuildCM";
|
||||
const char BUILDDEPENDCM[] = "ProjectExplorer.BuildDependenciesCM";
|
||||
const char BUILDSESSION[] = "ProjectExplorer.BuildSession";
|
||||
const char REBUILDPROJECTONLY[] = "ProjectExplorer.RebuildProjectOnly";
|
||||
const char REBUILD[] = "ProjectExplorer.Rebuild";
|
||||
const char REBUILDCM[] = "ProjectExplorer.RebuildCM";
|
||||
const char REBUILDDEPENDCM[] = "ProjectExplorer.RebuildDependenciesCM";
|
||||
const char REBUILDSESSION[] = "ProjectExplorer.RebuildSession";
|
||||
const char DEPLOYPROJECTONLY[] = "ProjectExplorer.DeployProjectOnly";
|
||||
const char DEPLOY[] = "ProjectExplorer.Deploy";
|
||||
const char DEPLOYCM[] = "ProjectExplorer.DeployCM";
|
||||
const char DEPLOYSESSION[] = "ProjectExplorer.DeploySession";
|
||||
const char CLEANPROJECTONLY[] = "ProjectExplorer.CleanProjectOnly";
|
||||
const char CLEAN[] = "ProjectExplorer.Clean";
|
||||
const char CLEANCM[] = "ProjectExplorer.CleanCM";
|
||||
const char CLEANDEPENDCM[] = "ProjectExplorer.CleanDependenciesCM";
|
||||
const char CLEANSESSION[] = "ProjectExplorer.CleanSession";
|
||||
const char CANCELBUILD[] = "ProjectExplorer.CancelBuild";
|
||||
const char RUN[] = "ProjectExplorer.Run";
|
||||
const char RUNWITHOUTDEPLOY[] = "ProjectExplorer.RunWithoutDeploy";
|
||||
const char RUNCONTEXTMENU[] = "ProjectExplorer.RunContextMenu";
|
||||
const char ADDNEWFILE[] = "ProjectExplorer.AddNewFile";
|
||||
const char ADDEXISTINGFILES[] = "ProjectExplorer.AddExistingFiles";
|
||||
const char ADDEXISTINGDIRECTORY[] = "ProjectExplorer.AddExistingDirectory";
|
||||
const char ADDNEWSUBPROJECT[] = "ProjectExplorer.AddNewSubproject";
|
||||
const char REMOVEPROJECT[] = "ProjectExplorer.RemoveProject";
|
||||
const char OPENFILE[] = "ProjectExplorer.OpenFile";
|
||||
const char SEARCHONFILESYSTEM[] = "ProjectExplorer.SearchOnFileSystem";
|
||||
const char SHOWINGRAPHICALSHELL[] = "ProjectExplorer.ShowInGraphicalShell";
|
||||
const char OPENTERMIANLHERE[] = "ProjectExplorer.OpenTerminalHere";
|
||||
const char REMOVEFILE[] = "ProjectExplorer.RemoveFile";
|
||||
const char DUPLICATEFILE[] = "ProjectExplorer.DuplicateFile";
|
||||
const char DELETEFILE[] = "ProjectExplorer.DeleteFile";
|
||||
const char RENAMEFILE[] = "ProjectExplorer.RenameFile";
|
||||
const char SETSTARTUP[] = "ProjectExplorer.SetStartup";
|
||||
const char PROJECTTREE_COLLAPSE_ALL[] = "ProjectExplorer.CollapseAll";
|
||||
|
||||
const char SELECTTARGET[] = "ProjectExplorer.SelectTarget";
|
||||
const char SELECTTARGETQUICK[] = "ProjectExplorer.SelectTargetQuick";
|
||||
|
||||
// Action priorities
|
||||
const int P_ACTION_RUN = 100;
|
||||
const int P_ACTION_BUILDPROJECT = 80;
|
||||
|
||||
// Context
|
||||
const char C_PROJECTEXPLORER[] = "Project Explorer";
|
||||
|
||||
// Menus
|
||||
const char M_RECENTPROJECTS[] = "ProjectExplorer.Menu.Recent";
|
||||
const char M_UNLOADPROJECTS[] = "ProjectExplorer.Menu.Unload";
|
||||
const char M_SESSION[] = "ProjectExplorer.Menu.Session";
|
||||
|
||||
// Menu groups
|
||||
const char G_BUILD_RUN[] = "ProjectExplorer.Group.Run";
|
||||
const char G_BUILD_CANCEL[] = "ProjectExplorer.Group.BuildCancel";
|
||||
|
||||
const char RUNMENUCONTEXTMENU[] = "Project.RunMenu";
|
||||
|
||||
} // namespace Constants
|
||||
|
||||
static Target *activeTarget()
|
||||
{
|
||||
Project *project = ProjectTree::currentProject();
|
||||
@@ -1250,7 +1321,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
return projectFilePath.toString();
|
||||
});
|
||||
|
||||
expander->registerVariable(Constants::VAR_CURRENTPROJECT_BUILDPATH,
|
||||
expander->registerVariable("CurrentProject:BuildPath",
|
||||
tr("Full build path of the current project's active build configuration."),
|
||||
[]() -> QString {
|
||||
BuildConfiguration *bc = activeBuildConfiguration();
|
||||
@@ -1285,7 +1356,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
return kit ? kit->id().toString() : QString();
|
||||
});
|
||||
|
||||
expander->registerVariable(Constants::VAR_CURRENTDEVICE_HOSTADDRESS,
|
||||
expander->registerVariable("CurrentDevice:HostAddress",
|
||||
tr("The host address of the device in the currently active kit."),
|
||||
[]() -> QString {
|
||||
Kit *kit = currentKit();
|
||||
@@ -1293,7 +1364,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
return device ? device->sshParameters().host : QString();
|
||||
});
|
||||
|
||||
expander->registerVariable(Constants::VAR_CURRENTDEVICE_SSHPORT,
|
||||
expander->registerVariable("CurrentDevice:SshPort",
|
||||
tr("The SSH port of the device in the currently active kit."),
|
||||
[]() -> QString {
|
||||
Kit *kit = currentKit();
|
||||
@@ -1301,7 +1372,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
return device ? QString::number(device->sshParameters().port) : QString();
|
||||
});
|
||||
|
||||
expander->registerVariable(Constants::VAR_CURRENTDEVICE_USERNAME,
|
||||
expander->registerVariable("CurrentDevice:UserName",
|
||||
tr("The username with which to log into the device in the currently active kit."),
|
||||
[]() -> QString {
|
||||
Kit *kit = currentKit();
|
||||
@@ -1310,7 +1381,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
});
|
||||
|
||||
|
||||
expander->registerVariable(Constants::VAR_CURRENTDEVICE_PRIVATEKEYFILE,
|
||||
expander->registerVariable("CurrentDevice:PrivateKeyFile",
|
||||
tr("The private key file with which to authenticate when logging into the device "
|
||||
"in the currently active kit."),
|
||||
[]() -> QString {
|
||||
@@ -1336,7 +1407,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
return QString();
|
||||
});
|
||||
|
||||
expander->registerFileVariables(Constants::VAR_CURRENTRUN_EXECUTABLE_PREFIX,
|
||||
expander->registerFileVariables("CurrentRun:Executable",
|
||||
tr("The currently active run configuration's executable (if applicable)"),
|
||||
[this]() -> QString {
|
||||
if (Target *target = activeTarget()) {
|
||||
@@ -1346,8 +1417,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
}
|
||||
}
|
||||
return QString();
|
||||
},
|
||||
true);
|
||||
});
|
||||
|
||||
expander->registerVariable(Constants::VAR_CURRENTBUILD_TYPE,
|
||||
tr("The currently active build configuration's type."),
|
||||
@@ -3141,7 +3211,7 @@ void ProjectExplorerPluginPrivate::removeProject()
|
||||
RemoveFileDialog removeFileDialog(subProjectNode->filePath().toString(), ICore::mainWindow());
|
||||
removeFileDialog.setDeleteFileVisible(false);
|
||||
if (removeFileDialog.exec() == QDialog::Accepted)
|
||||
projectNode->removeSubProjects(QStringList() << subProjectNode->filePath().toString());
|
||||
projectNode->removeSubProject(subProjectNode->filePath().toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -26,7 +26,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "projectexplorer_export.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "runconfiguration.h"
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
@@ -32,84 +32,24 @@ namespace Constants {
|
||||
|
||||
// Modes and their priorities
|
||||
const char MODE_SESSION[] = "Project";
|
||||
const int P_MODE_SESSION = 85;
|
||||
|
||||
// Actions
|
||||
const char NEWSESSION[] = "ProjectExplorer.NewSession";
|
||||
const char NEWPROJECT[] = "ProjectExplorer.NewProject";
|
||||
const char LOAD[] = "ProjectExplorer.Load";
|
||||
const char UNLOAD[] = "ProjectExplorer.Unload";
|
||||
const char UNLOADCM[] = "ProjectExplorer.UnloadCM";
|
||||
const char CLEARSESSION[] = "ProjectExplorer.ClearSession";
|
||||
const char BUILDPROJECTONLY[] = "ProjectExplorer.BuildProjectOnly";
|
||||
const char BUILD[] = "ProjectExplorer.Build";
|
||||
const char BUILDCM[] = "ProjectExplorer.BuildCM";
|
||||
const char BUILDDEPENDCM[] = "ProjectExplorer.BuildDependenciesCM";
|
||||
const char BUILDSESSION[] = "ProjectExplorer.BuildSession";
|
||||
const char REBUILDPROJECTONLY[] = "ProjectExplorer.RebuildProjectOnly";
|
||||
const char REBUILD[] = "ProjectExplorer.Rebuild";
|
||||
const char REBUILDCM[] = "ProjectExplorer.RebuildCM";
|
||||
const char REBUILDDEPENDCM[] = "ProjectExplorer.RebuildDependenciesCM";
|
||||
const char REBUILDSESSION[] = "ProjectExplorer.RebuildSession";
|
||||
const char DEPLOYPROJECTONLY[] = "ProjectExplorer.DeployProjectOnly";
|
||||
const char DEPLOY[] = "ProjectExplorer.Deploy";
|
||||
const char DEPLOYCM[] = "ProjectExplorer.DeployCM";
|
||||
const char DEPLOYSESSION[] = "ProjectExplorer.DeploySession";
|
||||
const char PUBLISH[] = "ProjectExplorer.Publish";
|
||||
const char CLEANPROJECTONLY[] = "ProjectExplorer.CleanProjectOnly";
|
||||
const char CLEAN[] = "ProjectExplorer.Clean";
|
||||
const char CLEANCM[] = "ProjectExplorer.CleanCM";
|
||||
const char CLEANDEPENDCM[] = "ProjectExplorer.CleanDependenciesCM";
|
||||
const char CLEANSESSION[] = "ProjectExplorer.CleanSession";
|
||||
const char CANCELBUILD[] = "ProjectExplorer.CancelBuild";
|
||||
const char RUN[] = "ProjectExplorer.Run";
|
||||
const char RUNWITHOUTDEPLOY[] = "ProjectExplorer.RunWithoutDeploy";
|
||||
const char RUNCONTEXTMENU[] = "ProjectExplorer.RunContextMenu";
|
||||
const char STOP[] = "ProjectExplorer.Stop";
|
||||
const char ADDNEWFILE[] = "ProjectExplorer.AddNewFile";
|
||||
const char ADDEXISTINGFILES[] = "ProjectExplorer.AddExistingFiles";
|
||||
const char ADDEXISTINGDIRECTORY[] = "ProjectExplorer.AddExistingDirectory";
|
||||
const char ADDNEWSUBPROJECT[] = "ProjectExplorer.AddNewSubproject";
|
||||
const char REMOVEPROJECT[] = "ProjectExplorer.RemoveProject";
|
||||
const char OPENFILE[] = "ProjectExplorer.OpenFile";
|
||||
const char SEARCHONFILESYSTEM[] = "ProjectExplorer.SearchOnFileSystem";
|
||||
const char SHOWINGRAPHICALSHELL[] = "ProjectExplorer.ShowInGraphicalShell";
|
||||
const char OPENTERMIANLHERE[] = "ProjectExplorer.OpenTerminalHere";
|
||||
const char REMOVEFILE[] = "ProjectExplorer.RemoveFile";
|
||||
const char DUPLICATEFILE[] = "ProjectExplorer.DuplicateFile";
|
||||
const char DELETEFILE[] = "ProjectExplorer.DeleteFile";
|
||||
const char RENAMEFILE[] = "ProjectExplorer.RenameFile";
|
||||
const char SETSTARTUP[] = "ProjectExplorer.SetStartup";
|
||||
const char PROJECTTREE_COLLAPSE_ALL[] = "ProjectExplorer.CollapseAll";
|
||||
|
||||
const char SELECTTARGET[] = "ProjectExplorer.SelectTarget";
|
||||
const char SELECTTARGETQUICK[] = "ProjectExplorer.SelectTargetQuick";
|
||||
|
||||
// Action priorities
|
||||
const int P_ACTION_RUN = 100;
|
||||
const int P_ACTION_BUILDPROJECT = 80;
|
||||
|
||||
// Context
|
||||
const char C_PROJECTEXPLORER[] = "Project Explorer";
|
||||
const char C_PROJECT_TREE[] = "ProjectExplorer.ProjectTreeContext";
|
||||
const char C_APP_OUTPUT[] = "ProjectExplorer.ApplicationOutput";
|
||||
const char C_COMPILE_OUTPUT[] = "ProjectExplorer.CompileOutput";
|
||||
|
||||
// Menus
|
||||
const char M_RECENTPROJECTS[] = "ProjectExplorer.Menu.Recent";
|
||||
const char M_UNLOADPROJECTS[] = "ProjectExplorer.Menu.Unload";
|
||||
const char M_BUILDPROJECT[] = "ProjectExplorer.Menu.Build";
|
||||
const char M_DEBUG[] = "ProjectExplorer.Menu.Debug";
|
||||
const char M_DEBUG_STARTDEBUGGING[] = "ProjectExplorer.Menu.Debug.StartDebugging";
|
||||
const char M_SESSION[] = "ProjectExplorer.Menu.Session";
|
||||
|
||||
// Menu groups
|
||||
const char G_BUILD_BUILD[] = "ProjectExplorer.Group.Build";
|
||||
const char G_BUILD_DEPLOY[] = "ProjectExplorer.Group.Deploy";
|
||||
const char G_BUILD_REBUILD[] = "ProjectExplorer.Group.Rebuild";
|
||||
const char G_BUILD_CLEAN[] = "ProjectExplorer.Group.Clean";
|
||||
const char G_BUILD_RUN[] = "ProjectExplorer.Group.Run";
|
||||
const char G_BUILD_CANCEL[] = "ProjectExplorer.Group.BuildCancel";
|
||||
|
||||
// Context menus
|
||||
const char M_SESSIONCONTEXT[] = "Project.Menu.Session";
|
||||
@@ -141,11 +81,6 @@ const char G_FILE_OPEN[] = "ProjectFile.Group.Open";
|
||||
const char G_FILE_OTHER[] = "ProjectFile.Group.Other";
|
||||
const char G_FILE_CONFIG[] = "ProjectFile.Group.Config";
|
||||
|
||||
const char RUNMENUCONTEXTMENU[] = "Project.RunMenu";
|
||||
|
||||
// File factory
|
||||
const char FILE_FACTORY_ID[] = "ProjectExplorer.FileFactoryId";
|
||||
|
||||
// Mime types
|
||||
const char C_SOURCE_MIMETYPE[] = "text/x-csrc";
|
||||
const char C_HEADER_MIMETYPE[] = "text/x-chdr";
|
||||
@@ -176,10 +111,6 @@ const char TASK_CATEGORY_COMPILE[] = "Task.Category.Compile";
|
||||
const char TASK_CATEGORY_BUILDSYSTEM[] = "Task.Category.Buildsystem";
|
||||
const char TASK_CATEGORY_DEPLOYMENT[] = "Task.Category.Deploy";
|
||||
|
||||
// Task mark categories
|
||||
const char TASK_MARK_WARNING[] = "Task.Mark.Warning";
|
||||
const char TASK_MARK_ERROR[] = "Task.Mark.Error";
|
||||
|
||||
// Wizard categories
|
||||
const char QT_PROJECT_WIZARD_CATEGORY[] = "H.Project";
|
||||
const char QT_PROJECT_WIZARD_CATEGORY_DISPLAY[] = QT_TRANSLATE_NOOP("ProjectExplorer", "Other Project");
|
||||
@@ -202,9 +133,6 @@ const char BUILDSTEPS_CLEAN[] = "ProjectExplorer.BuildSteps.Clean";
|
||||
const char BUILDSTEPS_BUILD[] = "ProjectExplorer.BuildSteps.Build";
|
||||
const char BUILDSTEPS_DEPLOY[] = "ProjectExplorer.BuildSteps.Deploy";
|
||||
|
||||
// Deploy Configuration id:
|
||||
const char DEFAULT_DEPLOYCONFIGURATION_ID[] = "ProjectExplorer.DefaultDeployConfiguration";
|
||||
|
||||
// Language
|
||||
|
||||
// Keep these short: These constants are exposed to the MacroExplorer!
|
||||
@@ -234,7 +162,6 @@ const int DESKTOP_PORT_END = 31000;
|
||||
|
||||
// Variable Names:
|
||||
const char VAR_CURRENTPROJECT_PREFIX[] = "CurrentProject";
|
||||
const char VAR_CURRENTPROJECT_BUILDPATH[] = "CurrentProject:BuildPath";
|
||||
const char VAR_CURRENTPROJECT_NAME[] = "CurrentProject:Name";
|
||||
const char VAR_CURRENTKIT_NAME[] = "CurrentKit:Name";
|
||||
const char VAR_CURRENTKIT_FILESYSTEMNAME[] = "CurrentKit:FileSystemName";
|
||||
@@ -243,19 +170,6 @@ const char VAR_CURRENTBUILD_NAME[] = "CurrentBuild:Name";
|
||||
const char VAR_CURRENTBUILD_TYPE[] = "CurrentBuild:Type";
|
||||
const char VAR_CURRENTBUILD_ENV[] = "CurrentBuild:Env";
|
||||
const char VAR_CURRENTRUN_NAME[] = "CurrentRun:Name";
|
||||
const char VAR_CURRENTRUN_ENV[] = "CurrentRun:Env";
|
||||
const char VAR_CURRENTRUN_EXECUTABLE_PREFIX[] = "CurrentRun:Executable";
|
||||
const char VAR_CURRENTDEVICE_HOSTADDRESS[] = "CurrentDevice:HostAddress";
|
||||
const char VAR_CURRENTDEVICE_SSHPORT[] = "CurrentDevice:SshPort";
|
||||
const char VAR_CURRENTDEVICE_USERNAME[] = "CurrentDevice:UserName";
|
||||
const char VAR_CURRENTDEVICE_PRIVATEKEYFILE[] = "CurrentDevice:PrivateKeyFile";
|
||||
|
||||
const char HIDE_FILE_FILTER_SETTING[] = "GenericProject/FileFilter";
|
||||
const char HIDE_FILE_FILTER_DEFAULT[] = "Makefile*; *.o; *.lo; *.la; *.obj; *~; *.files;"
|
||||
" *.config; *.creator; *.user*; *.includes; *.autosave";
|
||||
|
||||
const char SHOW_FILE_FILTER_SETTING[] = "GenericProject/ShowFileFilter";
|
||||
const char SHOW_FILE_FILTER_DEFAULT[] = "*.c; *.cc; *.cpp; *.cp; *.cxx; *.c++; *.h; *.hh; *.hpp; *.hxx;";
|
||||
|
||||
// JsonWizard:
|
||||
const char PAGE_ID_PREFIX[] = "PE.Wizard.Page.";
|
||||
@@ -282,10 +196,5 @@ const char FILEOVERLAY_H[]=":/projectexplorer/images/fileoverlay_h.png";
|
||||
const char FILEOVERLAY_SCXML[]=":/projectexplorer/images/fileoverlay_scxml.png";
|
||||
const char FILEOVERLAY_UNKNOWN[]=":/projectexplorer/images/fileoverlay_unknown.png";
|
||||
|
||||
// Kit Information
|
||||
const char KITINFORMATION_ID_V1[] = "PE.Profile.ToolChain";
|
||||
const char KITINFORMATION_ID_V2[] = "PE.Profile.ToolChains";
|
||||
const char KITINFORMATION_ID_V3[] = "PE.Profile.ToolChainsV3";
|
||||
|
||||
} // namespace Constants
|
||||
} // namespace ProjectExplorer
|
||||
|
@@ -181,7 +181,7 @@ bool ProjectFileWizardExtension::processProject(
|
||||
if (!folder)
|
||||
return true;
|
||||
if (m_context->wizard->kind() == IWizardFactory::ProjectWizard) {
|
||||
if (!static_cast<ProjectNode *>(folder)->addSubProjects(QStringList(generatedProject))) {
|
||||
if (!static_cast<ProjectNode *>(folder)->addSubProject(generatedProject)) {
|
||||
*errorMessage = tr("Failed to add subproject \"%1\"\nto project \"%2\".")
|
||||
.arg(generatedProject).arg(folder->filePath().toUserOutput());
|
||||
return false;
|
||||
|
@@ -720,15 +720,15 @@ bool ProjectNode::canAddSubProject(const QString &proFilePath) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ProjectNode::addSubProjects(const QStringList &proFilePaths)
|
||||
bool ProjectNode::addSubProject(const QString &proFilePath)
|
||||
{
|
||||
Q_UNUSED(proFilePaths)
|
||||
Q_UNUSED(proFilePath)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ProjectNode::removeSubProjects(const QStringList &proFilePaths)
|
||||
bool ProjectNode::removeSubProject(const QString &proFilePath)
|
||||
{
|
||||
Q_UNUSED(proFilePaths)
|
||||
Q_UNUSED(proFilePath)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -40,7 +40,7 @@ namespace Utils { class MimeType; }
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class RunConfiguration;
|
||||
class Project;
|
||||
class SessionManager;
|
||||
|
||||
enum class NodeType : quint16 {
|
||||
File = 1,
|
||||
@@ -278,8 +278,8 @@ public:
|
||||
QString vcsTopic() const;
|
||||
|
||||
virtual bool canAddSubProject(const QString &proFilePath) const;
|
||||
virtual bool addSubProjects(const QStringList &proFilePaths);
|
||||
virtual bool removeSubProjects(const QStringList &proFilePaths);
|
||||
virtual bool addSubProject(const QString &proFile);
|
||||
virtual bool removeSubProject(const QString &proFilePath);
|
||||
|
||||
bool addFiles(const QStringList &filePaths, QStringList *notAdded = 0) override;
|
||||
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = 0) override;
|
||||
@@ -302,7 +302,7 @@ protected:
|
||||
// will add the persistent stuff
|
||||
explicit ProjectNode(const Utils::FileName &projectFilePath);
|
||||
|
||||
friend class Project;
|
||||
friend class SessionManager;
|
||||
};
|
||||
|
||||
// Documentation inside.
|
||||
|
@@ -225,7 +225,7 @@ void RunConfiguration::ctor()
|
||||
BuildConfiguration *bc = target()->activeBuildConfiguration();
|
||||
return bc ? bc->macroExpander() : target()->macroExpander();
|
||||
});
|
||||
expander->registerPrefix(Constants::VAR_CURRENTRUN_ENV, tr("Variables in the current run environment"),
|
||||
expander->registerPrefix("CurrentRun:Env", tr("Variables in the current run environment"),
|
||||
[this](const QString &var) {
|
||||
const auto envAspect = extraAspect<EnvironmentAspect>();
|
||||
return envAspect ? envAspect->environment().value(var) : QString();
|
||||
|
@@ -43,6 +43,10 @@
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
const char HIDE_FILE_FILTER_DEFAULT[] = "Makefile*; *.o; *.lo; *.la; *.obj; *~; *.files;"
|
||||
" *.config; *.creator; *.user*; *.includes; *.autosave";
|
||||
const char SHOW_FILE_FILTER_DEFAULT[] = "*.c; *.cc; *.cpp; *.cp; *.cxx; *.c++; *.h; *.hh; *.hpp; *.hxx;";
|
||||
|
||||
Tree::~Tree()
|
||||
{
|
||||
qDeleteAll(childDirectories);
|
||||
@@ -550,11 +554,11 @@ SelectableFilesWidget::SelectableFilesWidget(QWidget *parent) :
|
||||
m_progressLabel(new QLabel)
|
||||
{
|
||||
const QString showFilter
|
||||
= Core::ICore::settings()->value(QLatin1String(Constants::SHOW_FILE_FILTER_SETTING),
|
||||
QLatin1String(Constants::SHOW_FILE_FILTER_DEFAULT)).toString();
|
||||
= Core::ICore::settings()->value("GenericProject/ShowFileFilter",
|
||||
QLatin1String(SHOW_FILE_FILTER_DEFAULT)).toString();
|
||||
const QString hideFilter
|
||||
= Core::ICore::settings()->value(QLatin1String(Constants::HIDE_FILE_FILTER_SETTING),
|
||||
QLatin1String(Constants::HIDE_FILE_FILTER_DEFAULT)).toString();
|
||||
= Core::ICore::settings()->value("GenericProject/FileFilter",
|
||||
QLatin1String(HIDE_FILE_FILTER_DEFAULT)).toString();
|
||||
|
||||
auto layout = new QGridLayout(this);
|
||||
layout->setMargin(0);
|
||||
|
@@ -205,7 +205,14 @@ void SessionManager::updateProjectTree(Project *pro)
|
||||
return; // Project was already de-registered and is shutting down
|
||||
|
||||
ProjectNode *const oldNode = currentPair->second;
|
||||
ProjectNode *const newNode = pro->rootProjectNode();
|
||||
ProjectNode *newNode = pro->rootProjectNode();
|
||||
|
||||
if (!newNode) {
|
||||
// Set up generic project structure if the project does not provide any!
|
||||
newNode = new ProjectNode(pro->projectDirectory());
|
||||
newNode->setDisplayName(pro->displayName());
|
||||
newNode->addNode(new FileNode(pro->projectFilePath(), FileType::Project, false));
|
||||
}
|
||||
|
||||
d->m_sessionNode.replaceSubtree(oldNode, newNode);
|
||||
currentPair->second = newNode;
|
||||
@@ -766,6 +773,10 @@ void SessionManager::removeProjects(QList<Project *> remove)
|
||||
pro->saveSettings();
|
||||
pro->setRootProjectNode(nullptr); // Deregister project with sessionnode!
|
||||
|
||||
// Remove the project node:
|
||||
Node *projectNode = nodeForProject(pro);
|
||||
d->m_sessionNode.removeNode(projectNode);
|
||||
|
||||
d->m_projects
|
||||
= Utils::filtered(d->m_projects, [pro](const QPair<Project *, ProjectNode *> &pair)
|
||||
{
|
||||
|
@@ -31,7 +31,11 @@
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/theme/theme.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
namespace ProjectExplorer {
|
||||
|
||||
// Task mark categories
|
||||
const char TASK_MARK_WARNING[] = "Task.Mark.Warning";
|
||||
const char TASK_MARK_ERROR[] = "Task.Mark.Error";
|
||||
|
||||
static TaskHub *m_instance = nullptr;
|
||||
QVector<Core::Id> TaskHub::m_registeredCategories;
|
||||
@@ -40,9 +44,9 @@ static Core::Id categoryForType(Task::TaskType type)
|
||||
{
|
||||
switch (type) {
|
||||
case Task::Error:
|
||||
return Constants::TASK_MARK_ERROR;
|
||||
return TASK_MARK_ERROR;
|
||||
case Task::Warning:
|
||||
return Constants::TASK_MARK_WARNING;
|
||||
return TASK_MARK_WARNING;
|
||||
default:
|
||||
return Core::Id();
|
||||
}
|
||||
@@ -101,12 +105,12 @@ TaskHub::TaskHub()
|
||||
m_instance = this;
|
||||
qRegisterMetaType<ProjectExplorer::Task>("ProjectExplorer::Task");
|
||||
qRegisterMetaType<QList<ProjectExplorer::Task> >("QList<ProjectExplorer::Task>");
|
||||
TaskMark::setCategoryColor(Constants::TASK_MARK_ERROR,
|
||||
TaskMark::setCategoryColor(TASK_MARK_ERROR,
|
||||
Utils::Theme::ProjectExplorer_TaskError_TextMarkColor);
|
||||
TaskMark::setCategoryColor(Constants::TASK_MARK_WARNING,
|
||||
TaskMark::setCategoryColor(TASK_MARK_WARNING,
|
||||
Utils::Theme::ProjectExplorer_TaskWarn_TextMarkColor);
|
||||
TaskMark::setDefaultToolTip(Constants::TASK_MARK_ERROR, tr("Error"));
|
||||
TaskMark::setDefaultToolTip(Constants::TASK_MARK_WARNING, tr("Warning"));
|
||||
TaskMark::setDefaultToolTip(TASK_MARK_ERROR, tr("Error"));
|
||||
TaskMark::setDefaultToolTip(TASK_MARK_WARNING, tr("Warning"));
|
||||
}
|
||||
|
||||
TaskHub::~TaskHub()
|
||||
@@ -194,3 +198,5 @@ void TaskHub::requestPopup()
|
||||
{
|
||||
emit m_instance->popupRequested(Core::IOutputPane::NoModeSwitch);
|
||||
}
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
@@ -26,7 +26,6 @@
|
||||
#include "taskwindow.h"
|
||||
|
||||
#include "itaskhandler.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "projectexplorericons.h"
|
||||
#include "session.h"
|
||||
#include "task.h"
|
||||
|
@@ -32,6 +32,12 @@
|
||||
namespace QmakeProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
// Determine name for Q_EXPORT_PLUGIN
|
||||
static inline QString createPluginName(const QString &prefix)
|
||||
{
|
||||
return prefix.toLower() + QLatin1String("plugin");
|
||||
}
|
||||
|
||||
CustomWidgetPluginWizardPage::CustomWidgetPluginWizardPage(QWidget *parent) :
|
||||
QWizardPage(parent),
|
||||
m_ui(new Ui::CustomWidgetPluginWizardPage),
|
||||
@@ -39,8 +45,19 @@ CustomWidgetPluginWizardPage::CustomWidgetPluginWizardPage(QWidget *parent) :
|
||||
m_complete(false)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
connect(m_ui->collectionClassEdit, &QLineEdit::textEdited, this, &CustomWidgetPluginWizardPage::slotCheckCompleteness);
|
||||
connect(m_ui->pluginNameEdit, &QLineEdit::textEdited, this, &CustomWidgetPluginWizardPage::slotCheckCompleteness);
|
||||
connect(m_ui->collectionClassEdit, &QLineEdit::textEdited,
|
||||
this, &CustomWidgetPluginWizardPage::slotCheckCompleteness);
|
||||
connect(m_ui->collectionClassEdit, &QLineEdit::textChanged,
|
||||
this, [this](const QString &collectionClass) {
|
||||
m_ui->collectionHeaderEdit->setText(m_fileNamingParameters.headerFileName(collectionClass));
|
||||
m_ui->pluginNameEdit->setText(createPluginName(collectionClass));
|
||||
});
|
||||
connect(m_ui->pluginNameEdit, &QLineEdit::textEdited,
|
||||
this, &CustomWidgetPluginWizardPage::slotCheckCompleteness);
|
||||
connect(m_ui->collectionHeaderEdit, &QLineEdit::textChanged,
|
||||
this, [this](const QString &text) {
|
||||
m_ui->collectionSourceEdit->setText(m_fileNamingParameters.headerToSourceFileName(text));
|
||||
});
|
||||
|
||||
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Plugin Details"));
|
||||
}
|
||||
@@ -60,12 +77,6 @@ QString CustomWidgetPluginWizardPage::pluginName() const
|
||||
return m_ui->pluginNameEdit->text();
|
||||
}
|
||||
|
||||
// Determine name for Q_EXPORT_PLUGIN
|
||||
static inline QString createPluginName(const QString &prefix)
|
||||
{
|
||||
return prefix.toLower() + QLatin1String("plugin");
|
||||
}
|
||||
|
||||
void CustomWidgetPluginWizardPage::init(const CustomWidgetWidgetsWizardPage *widgetsPage)
|
||||
{
|
||||
m_classCount = widgetsPage->classCount();
|
||||
@@ -94,18 +105,6 @@ void CustomWidgetPluginWizardPage::setCollectionEnabled(bool enColl)
|
||||
m_ui->collectionSourceEdit->setEnabled(enColl);
|
||||
}
|
||||
|
||||
void CustomWidgetPluginWizardPage::on_collectionClassEdit_textChanged()
|
||||
{
|
||||
const QString collectionClass = collectionClassName();
|
||||
m_ui->collectionHeaderEdit->setText(m_fileNamingParameters.headerFileName(collectionClass));
|
||||
m_ui->pluginNameEdit->setText(createPluginName(collectionClass));
|
||||
}
|
||||
|
||||
void CustomWidgetPluginWizardPage::on_collectionHeaderEdit_textChanged()
|
||||
{
|
||||
m_ui->collectionSourceEdit->setText(m_fileNamingParameters.headerToSourceFileName(m_ui->collectionHeaderEdit->text()));
|
||||
}
|
||||
|
||||
QSharedPointer<PluginOptions> CustomWidgetPluginWizardPage::basicPluginOptions() const
|
||||
{
|
||||
QSharedPointer<PluginOptions> po(new PluginOptions);
|
||||
|
@@ -56,12 +56,8 @@ public:
|
||||
// Fills the plugin fields, excluding widget list.
|
||||
QSharedPointer<PluginOptions> basicPluginOptions() const;
|
||||
|
||||
private slots:
|
||||
void on_collectionClassEdit_textChanged();
|
||||
void on_collectionHeaderEdit_textChanged();
|
||||
void slotCheckCompleteness();
|
||||
|
||||
private:
|
||||
void slotCheckCompleteness();
|
||||
inline QString collectionClassName() const;
|
||||
inline QString pluginName() const;
|
||||
void setCollectionEnabled(bool enColl);
|
||||
|
@@ -156,6 +156,13 @@ void QmakeBuildConfiguration::ctor()
|
||||
this, &QmakeBuildConfiguration::emitProFileEvaluateNeeded);
|
||||
connect(target(), &Target::kitChanged,
|
||||
this, &QmakeBuildConfiguration::kitChanged);
|
||||
MacroExpander *expander = macroExpander();
|
||||
expander->registerVariable("Qmake:Makefile", "Qmake makefile", [this]() -> QString {
|
||||
const QString file = makefile();
|
||||
if (!file.isEmpty())
|
||||
return file;
|
||||
return QLatin1String("Makefile");
|
||||
});
|
||||
}
|
||||
|
||||
void QmakeBuildConfiguration::kitChanged()
|
||||
|
@@ -53,8 +53,8 @@ public:
|
||||
ProjectExplorer::NamedWidget *createConfigWidget() override;
|
||||
bool isShadowBuild() const;
|
||||
|
||||
void setSubNodeBuild(QmakeProjectManager::QmakeProFileNode *node);
|
||||
QmakeProjectManager::QmakeProFileNode *subNodeBuild() const;
|
||||
void setSubNodeBuild(QmakeProFileNode *node);
|
||||
QmakeProFileNode *subNodeBuild() const;
|
||||
|
||||
ProjectExplorer::FileNode *fileNodeBuild() const;
|
||||
void setFileNodeBuild(ProjectExplorer::FileNode *node);
|
||||
@@ -138,7 +138,7 @@ private:
|
||||
bool m_shadowBuild = true;
|
||||
bool m_isEnabled = true;
|
||||
QtSupport::BaseQtVersion::QmakeBuildConfigs m_qmakeBuildConfiguration = 0;
|
||||
QmakeProjectManager::QmakeProFileNode *m_subNodeBuild = nullptr;
|
||||
QmakeProFileNode *m_subNodeBuild = nullptr;
|
||||
ProjectExplorer::FileNode *m_fileNodeBuild = nullptr;
|
||||
|
||||
friend class Internal::QmakeProjectConfigWidget;
|
||||
|
@@ -148,16 +148,16 @@ bool QmakePriFileNode::canAddSubProject(const QString &proFilePath) const
|
||||
return pri ? pri->canAddSubProject(proFilePath) : false;
|
||||
}
|
||||
|
||||
bool QmakePriFileNode::addSubProjects(const QStringList &proFilePaths)
|
||||
bool QmakePriFileNode::addSubProject(const QString &proFilePath)
|
||||
{
|
||||
QmakePriFile *pri = priFile();
|
||||
return pri ? pri->addSubProjects(proFilePaths) : false;
|
||||
return pri ? pri->addSubProject(proFilePath) : false;
|
||||
}
|
||||
|
||||
bool QmakePriFileNode::removeSubProjects(const QStringList &proFilePaths)
|
||||
bool QmakePriFileNode::removeSubProject(const QString &proFilePath)
|
||||
{
|
||||
QmakePriFile *pri = priFile();
|
||||
return pri ? pri->removeSubProjects(proFilePaths) : false;
|
||||
return pri ? pri->removeSubProjects(proFilePath) : false;
|
||||
}
|
||||
|
||||
bool QmakePriFileNode::addFiles(const QStringList &filePaths, QStringList *notAdded)
|
||||
|
@@ -53,8 +53,8 @@ public:
|
||||
|
||||
bool canAddSubProject(const QString &proFilePath) const override;
|
||||
|
||||
bool addSubProjects(const QStringList &proFilePaths) override;
|
||||
bool removeSubProjects(const QStringList &proFilePaths) override;
|
||||
bool addSubProject(const QString &proFilePath) override;
|
||||
bool removeSubProject(const QString &proFilePath) override;
|
||||
|
||||
bool addFiles(const QStringList &filePaths, QStringList *notAdded = nullptr) override;
|
||||
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = nullptr) override;
|
||||
|
@@ -474,13 +474,11 @@ static QString simplifyProFilePath(const QString &proFilePath)
|
||||
return proFilePath;
|
||||
}
|
||||
|
||||
bool QmakePriFile::addSubProjects(const QStringList &proFilePaths)
|
||||
bool QmakePriFile::addSubProject(const QString &proFile)
|
||||
{
|
||||
QStringList uniqueProFilePaths;
|
||||
foreach (const QString &proFile, proFilePaths) {
|
||||
if (!m_recursiveEnumerateFiles.contains(FileName::fromString(proFile)))
|
||||
uniqueProFilePaths.append(simplifyProFilePath(proFile));
|
||||
}
|
||||
|
||||
QStringList failedFiles;
|
||||
changeFiles(QLatin1String(Constants::PROFILE_MIMETYPE), uniqueProFilePaths, &failedFiles, AddToProFile);
|
||||
@@ -488,10 +486,10 @@ bool QmakePriFile::addSubProjects(const QStringList &proFilePaths)
|
||||
return failedFiles.isEmpty();
|
||||
}
|
||||
|
||||
bool QmakePriFile::removeSubProjects(const QStringList &proFilePaths)
|
||||
bool QmakePriFile::removeSubProjects(const QString &proFilePath)
|
||||
{
|
||||
QStringList failedOriginalFiles;
|
||||
changeFiles(QLatin1String(Constants::PROFILE_MIMETYPE), proFilePaths, &failedOriginalFiles, RemoveFromProFile);
|
||||
changeFiles(QLatin1String(Constants::PROFILE_MIMETYPE), QStringList(proFilePath), &failedOriginalFiles, RemoveFromProFile);
|
||||
|
||||
QStringList simplifiedProFiles = Utils::transform(failedOriginalFiles, &simplifyProFilePath);
|
||||
|
||||
|
@@ -134,8 +134,8 @@ public:
|
||||
// ProjectNode interface
|
||||
virtual bool canAddSubProject(const QString &proFilePath) const;
|
||||
|
||||
virtual bool addSubProjects(const QStringList &proFilePaths);
|
||||
virtual bool removeSubProjects(const QStringList &proFilePaths);
|
||||
virtual bool addSubProject(const QString &proFile);
|
||||
virtual bool removeSubProjects(const QString &proFilePath);
|
||||
|
||||
virtual bool addFiles(const QStringList &filePaths, QStringList *notAdded = nullptr);
|
||||
virtual bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = nullptr);
|
||||
|
@@ -508,7 +508,7 @@ QString QMakeStep::effectiveQMakeCall() const
|
||||
|
||||
QString result = qmake;
|
||||
if (qtVersion) {
|
||||
result += QLatin1Char(' ') + allArguments(qtVersion);
|
||||
result += ' ' + buildConfiguration()->macroExpander()->expand(allArguments(qtVersion));
|
||||
if (qtVersion->qtVersion() >= QtVersionNumber(5, 0, 0))
|
||||
result.append(QString::fromLatin1(" && %1 %2").arg(make).arg(makeArguments()));
|
||||
}
|
||||
|
@@ -76,7 +76,7 @@ SelectionContext AbstractAction::selectionContext() const
|
||||
DefaultAction::DefaultAction(const QString &description)
|
||||
: QAction(description, 0)
|
||||
{
|
||||
connect(this, SIGNAL(triggered(bool)), this, SLOT(actionTriggered(bool)));
|
||||
connect(this, &QAction::triggered, this, &DefaultAction::actionTriggered);
|
||||
}
|
||||
|
||||
void DefaultAction::actionTriggered(bool enable)
|
||||
|
@@ -39,13 +39,13 @@ class QMLDESIGNERCORE_EXPORT DefaultAction : public QAction
|
||||
public:
|
||||
DefaultAction(const QString &description);
|
||||
|
||||
signals:
|
||||
void triggered(bool checked, const SelectionContext &selectionContext);
|
||||
|
||||
public slots: //virtual function instead of slot
|
||||
// virtual function instead of slot
|
||||
virtual void actionTriggered(bool enable);
|
||||
void setSelectionContext(const SelectionContext &selectionContext);
|
||||
|
||||
signals:
|
||||
void triggered(bool checked, const SelectionContext &selectionContext);
|
||||
|
||||
protected:
|
||||
SelectionContext m_selectionContext;
|
||||
};
|
||||
|
@@ -46,10 +46,8 @@ public:
|
||||
|
||||
Utils::CrumblePath *crumblePath();
|
||||
|
||||
private slots:
|
||||
void onCrumblePathElementClicked(const QVariant &data);
|
||||
|
||||
private:
|
||||
void onCrumblePathElementClicked(const QVariant &data);
|
||||
void updateVisibility();
|
||||
void showSaveDialog();
|
||||
|
||||
|
@@ -107,7 +107,6 @@ public:
|
||||
: DefaultAction(description), m_action(action)
|
||||
{ }
|
||||
|
||||
public /*slots*/:
|
||||
virtual void actionTriggered(bool b)
|
||||
{
|
||||
m_selectionContext.setToggled(b);
|
||||
|
@@ -36,7 +36,8 @@ namespace Internal {
|
||||
DebugViewWidget::DebugViewWidget(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
connect(m_ui.enabledCheckBox, SIGNAL(toggled(bool)), this, SLOT(enabledCheckBoxToggled(bool)));
|
||||
connect(m_ui.enabledCheckBox, &QAbstractButton::toggled,
|
||||
this, &DebugViewWidget::enabledCheckBoxToggled);
|
||||
}
|
||||
|
||||
void DebugViewWidget::addLogMessage(const QString &topic, const QString &message, bool highlight)
|
||||
|
@@ -45,7 +45,6 @@ public:
|
||||
|
||||
void setDebugViewEnabled(bool b);
|
||||
|
||||
public slots:
|
||||
void enabledCheckBoxToggled(bool b);
|
||||
|
||||
private:
|
||||
|
@@ -64,7 +64,8 @@ QWidget *BackgroundAction::createWidget(QWidget *parent)
|
||||
}
|
||||
|
||||
comboBox->setCurrentIndex(0);
|
||||
connect(comboBox, SIGNAL(currentIndexChanged(int)), SLOT(emitBackgroundChanged(int)));
|
||||
connect(comboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
this, &BackgroundAction::emitBackgroundChanged);
|
||||
|
||||
comboBox->setProperty("hideborder", true);
|
||||
comboBox->setToolTip(tr("Set the color of the canvas."));
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user