forked from qt-creator/qt-creator
mostly core and analyzer: more id-fication
Change-Id: Ic794fdc6a582f4a03d84b6220c59111044c753b9 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -580,7 +580,7 @@ void AnalyzerManagerPrivate::startLocalTool(IAnalyzerTool *tool, StartMode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_isRunning = true;
|
m_isRunning = true;
|
||||||
pe->runProject(pro, tool->id());
|
pe->runProject(pro, tool->id().toString());
|
||||||
updateRunActions();
|
updateRunActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -615,8 +615,7 @@ QAction *AnalyzerManagerPrivate::actionFromToolAndMode(IAnalyzerTool *tool, Star
|
|||||||
void AnalyzerManagerPrivate::selectSavedTool()
|
void AnalyzerManagerPrivate::selectSavedTool()
|
||||||
{
|
{
|
||||||
const QSettings *settings = Core::ICore::instance()->settings();
|
const QSettings *settings = Core::ICore::instance()->settings();
|
||||||
const QByteArray lastActiveAction =
|
const Core::Id lastActiveAction(settings->value(QLatin1String(LAST_ACTIVE_TOOL)).toString());
|
||||||
settings->value(QLatin1String(LAST_ACTIVE_TOOL), QString()).toByteArray();
|
|
||||||
foreach (QAction *action, m_actions) {
|
foreach (QAction *action, m_actions) {
|
||||||
IAnalyzerTool *tool = m_toolFromAction.value(action);
|
IAnalyzerTool *tool = m_toolFromAction.value(action);
|
||||||
StartMode mode = m_modeFromAction.value(action);
|
StartMode mode = m_modeFromAction.value(action);
|
||||||
@@ -700,8 +699,8 @@ void AnalyzerManagerPrivate::addTool(IAnalyzerTool *tool, const StartModes &mode
|
|||||||
ActionManager *am = Core::ICore::instance()->actionManager();
|
ActionManager *am = Core::ICore::instance()->actionManager();
|
||||||
foreach (StartMode mode, modes) {
|
foreach (StartMode mode, modes) {
|
||||||
QString actionName = tool->actionName(mode);
|
QString actionName = tool->actionName(mode);
|
||||||
QString menuGroup = tool->menuGroup(mode);
|
Id menuGroup = tool->menuGroup(mode);
|
||||||
Core::Id actionId(QString::fromLatin1(tool->actionId(mode)));
|
Id actionId = tool->actionId(mode);
|
||||||
QAction *action = new QAction(actionName, 0);
|
QAction *action = new QAction(actionName, 0);
|
||||||
Core::Command *command = am->registerAction(action, actionId,
|
Core::Command *command = am->registerAction(action, actionId,
|
||||||
Core::Context(Core::Constants::C_GLOBAL));
|
Core::Context(Core::Constants::C_GLOBAL));
|
||||||
@@ -742,7 +741,7 @@ void AnalyzerManagerPrivate::loadToolSettings(IAnalyzerTool *tool)
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(m_mainWindow, return);
|
QTC_ASSERT(m_mainWindow, return);
|
||||||
QSettings *settings = Core::ICore::instance()->settings();
|
QSettings *settings = Core::ICore::instance()->settings();
|
||||||
settings->beginGroup(QLatin1String("AnalyzerViewSettings_") + tool->id());
|
settings->beginGroup(QLatin1String("AnalyzerViewSettings_") + tool->id().toString());
|
||||||
if (settings->value("ToolSettingsSaved", false).toBool())
|
if (settings->value("ToolSettingsSaved", false).toBool())
|
||||||
m_mainWindow->restoreSettings(settings);
|
m_mainWindow->restoreSettings(settings);
|
||||||
else
|
else
|
||||||
@@ -757,11 +756,11 @@ void AnalyzerManagerPrivate::saveToolSettings(IAnalyzerTool *tool, StartMode mod
|
|||||||
QTC_ASSERT(m_mainWindow, return);
|
QTC_ASSERT(m_mainWindow, return);
|
||||||
|
|
||||||
QSettings *settings = Core::ICore::instance()->settings();
|
QSettings *settings = Core::ICore::instance()->settings();
|
||||||
settings->beginGroup(QLatin1String("AnalyzerViewSettings_") + tool->id());
|
settings->beginGroup(QLatin1String("AnalyzerViewSettings_") + tool->id().toString());
|
||||||
m_mainWindow->saveSettings(settings);
|
m_mainWindow->saveSettings(settings);
|
||||||
settings->setValue("ToolSettingsSaved", true);
|
settings->setValue("ToolSettingsSaved", true);
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
settings->setValue(QLatin1String(LAST_ACTIVE_TOOL), tool->actionId(mode));
|
settings->setValue(QLatin1String(LAST_ACTIVE_TOOL), tool->actionId(mode).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalyzerManagerPrivate::updateRunActions()
|
void AnalyzerManagerPrivate::updateRunActions()
|
||||||
@@ -770,7 +769,7 @@ void AnalyzerManagerPrivate::updateRunActions()
|
|||||||
Project *project = pe->startupProject();
|
Project *project = pe->startupProject();
|
||||||
|
|
||||||
bool startEnabled = !m_isRunning
|
bool startEnabled = !m_isRunning
|
||||||
&& m_currentTool && pe->canRun(project, m_currentTool->id());
|
&& m_currentTool && pe->canRun(project, m_currentTool->id().toString());
|
||||||
|
|
||||||
QString disabledReason;
|
QString disabledReason;
|
||||||
if (m_isRunning)
|
if (m_isRunning)
|
||||||
@@ -778,7 +777,7 @@ void AnalyzerManagerPrivate::updateRunActions()
|
|||||||
else if (!m_currentTool)
|
else if (!m_currentTool)
|
||||||
disabledReason = tr("No analyzer tool selected.");
|
disabledReason = tr("No analyzer tool selected.");
|
||||||
else
|
else
|
||||||
disabledReason = pe->cannotRunReason(project, m_currentTool->id());
|
disabledReason = pe->cannotRunReason(project, m_currentTool->id().toString());
|
||||||
|
|
||||||
m_startAction->setEnabled(startEnabled);
|
m_startAction->setEnabled(startEnabled);
|
||||||
m_startAction->setToolTip(disabledReason);
|
m_startAction->setToolTip(disabledReason);
|
||||||
@@ -921,12 +920,12 @@ void AnalyzerManager::handleToolFinished()
|
|||||||
m_instance->d->handleToolFinished();
|
m_instance->d->handleToolFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
IAnalyzerTool *AnalyzerManager::toolFromId(const QByteArray &id)
|
IAnalyzerTool *AnalyzerManager::toolFromId(const Core::Id &id)
|
||||||
{
|
{
|
||||||
foreach (IAnalyzerTool *tool, m_instance->d->m_tools)
|
foreach (IAnalyzerTool *tool, m_instance->d->m_tools)
|
||||||
if (id.startsWith(tool->id()))
|
if (id.name().startsWith(tool->id().name()))
|
||||||
return tool;
|
return tool;
|
||||||
QTC_ASSERT(false, qDebug() << "NO ANAYLYZER TOOL FOUND FOR ID" << id);
|
QTC_ASSERT(false, qDebug() << "NO ANAYLYZER TOOL FOUND FOR ID" << id.name());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -37,6 +37,7 @@
|
|||||||
|
|
||||||
#include "analyzerbase_global.h"
|
#include "analyzerbase_global.h"
|
||||||
#include "analyzerconstants.h"
|
#include "analyzerconstants.h"
|
||||||
|
#include <coreplugin/id.h>
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
@@ -71,8 +72,8 @@ public:
|
|||||||
|
|
||||||
// Register a tool and initialize it.
|
// Register a tool and initialize it.
|
||||||
static void addTool(IAnalyzerTool *tool, const StartModes &mode);
|
static void addTool(IAnalyzerTool *tool, const StartModes &mode);
|
||||||
static IAnalyzerTool *toolFromId(const QByteArray &id);
|
static IAnalyzerTool *toolFromId(const Core::Id &id);
|
||||||
static StartMode modeFromId(const QByteArray &id);
|
static StartMode modeFromId(const Core::Id &id);
|
||||||
|
|
||||||
// Dockwidgets are registered to the main window.
|
// Dockwidgets are registered to the main window.
|
||||||
static QDockWidget *createDockWidget(IAnalyzerTool *tool, const QString &title,
|
static QDockWidget *createDockWidget(IAnalyzerTool *tool, const QString &title,
|
||||||
|
@@ -80,7 +80,7 @@ AnalyzerRunControl::Private::Private()
|
|||||||
|
|
||||||
AnalyzerRunControl::AnalyzerRunControl(IAnalyzerTool *tool,
|
AnalyzerRunControl::AnalyzerRunControl(IAnalyzerTool *tool,
|
||||||
const AnalyzerStartParameters &sp, RunConfiguration *runConfiguration)
|
const AnalyzerStartParameters &sp, RunConfiguration *runConfiguration)
|
||||||
: RunControl(runConfiguration, tool->id()),
|
: RunControl(runConfiguration, tool->id().toString()),
|
||||||
d(new Private)
|
d(new Private)
|
||||||
{
|
{
|
||||||
d->m_engine = tool->createEngine(sp, runConfiguration);
|
d->m_engine = tool->createEngine(sp, runConfiguration);
|
||||||
|
@@ -38,6 +38,7 @@
|
|||||||
|
|
||||||
#include <QtCore/QMetaType>
|
#include <QtCore/QMetaType>
|
||||||
|
|
||||||
|
#include <coreplugin/id.h>
|
||||||
#include <utils/ssh/sshconnection.h>
|
#include <utils/ssh/sshconnection.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
|
|
||||||
@@ -56,7 +57,7 @@ public:
|
|||||||
StartMode startMode;
|
StartMode startMode;
|
||||||
Utils::SshConnectionParameters connParams;
|
Utils::SshConnectionParameters connParams;
|
||||||
|
|
||||||
QByteArray toolId;
|
Core::Id toolId;
|
||||||
QString debuggee;
|
QString debuggee;
|
||||||
QString debuggeeArgs;
|
QString debuggeeArgs;
|
||||||
QString analyzerCmdPrefix;
|
QString analyzerCmdPrefix;
|
||||||
|
@@ -41,25 +41,25 @@ IAnalyzerTool::IAnalyzerTool(QObject *parent)
|
|||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
QByteArray IAnalyzerTool::defaultMenuGroup(StartMode mode)
|
Core::Id IAnalyzerTool::defaultMenuGroup(StartMode mode)
|
||||||
{
|
{
|
||||||
if (mode == StartRemote)
|
if (mode == StartRemote)
|
||||||
return Analyzer::Constants::G_ANALYZER_REMOTE_TOOLS;
|
return Analyzer::Constants::G_ANALYZER_REMOTE_TOOLS;
|
||||||
return Analyzer::Constants::G_ANALYZER_TOOLS;
|
return Analyzer::Constants::G_ANALYZER_TOOLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray IAnalyzerTool::defaultActionId(const IAnalyzerTool *tool, StartMode mode)
|
Core::Id IAnalyzerTool::defaultActionId(const IAnalyzerTool *tool, StartMode mode)
|
||||||
{
|
{
|
||||||
QByteArray id = tool->id();
|
Core::Id id = tool->id();
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case Analyzer::StartLocal:
|
case Analyzer::StartLocal:
|
||||||
return "Analyzer." + id + ".Local";
|
return Core::Id(("Analyzer." + id.name() + ".Local").data());
|
||||||
case Analyzer::StartRemote:
|
case Analyzer::StartRemote:
|
||||||
return "Analyzer." + id + ".Remote";
|
return Core::Id(("Analyzer." + id.name() + ".Remote").data());
|
||||||
case Analyzer::StartQml:
|
case Analyzer::StartQml:
|
||||||
return "Analyzer." + id + ".Qml";
|
return Core::Id(("Analyzer." + id.name() + ".Qml").data());
|
||||||
}
|
}
|
||||||
return QByteArray();
|
return Core::Id();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IAnalyzerTool::defaultActionName(const IAnalyzerTool *tool, StartMode mode)
|
QString IAnalyzerTool::defaultActionName(const IAnalyzerTool *tool, StartMode mode)
|
||||||
|
@@ -38,6 +38,8 @@
|
|||||||
#include "analyzerbase_global.h"
|
#include "analyzerbase_global.h"
|
||||||
#include "analyzerconstants.h"
|
#include "analyzerconstants.h"
|
||||||
|
|
||||||
|
#include <coreplugin/id.h>
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
@@ -72,16 +74,16 @@ public:
|
|||||||
explicit IAnalyzerTool(QObject *parent = 0);
|
explicit IAnalyzerTool(QObject *parent = 0);
|
||||||
|
|
||||||
/// Returns a unique ID for this tool.
|
/// Returns a unique ID for this tool.
|
||||||
virtual QByteArray id() const = 0;
|
virtual Core::Id id() const = 0;
|
||||||
/// Returns a short user readable display name for this tool.
|
/// Returns a short user readable display name for this tool.
|
||||||
virtual QString displayName() const = 0;
|
virtual QString displayName() const = 0;
|
||||||
/// Returns a user readable description name for this tool.
|
/// Returns a user readable description name for this tool.
|
||||||
virtual QString description() const = 0;
|
virtual QString description() const = 0;
|
||||||
/// Returns an id for the start action.
|
/// Returns an id for the start action.
|
||||||
virtual QByteArray actionId(StartMode mode) const
|
virtual Core::Id actionId(StartMode mode) const
|
||||||
{ return defaultActionId(this, mode); }
|
{ return defaultActionId(this, mode); }
|
||||||
/// Returns the menu group the start action should go to.
|
/// Returns the menu group the start action should go to.
|
||||||
virtual QByteArray menuGroup(StartMode mode) const
|
virtual Core::Id menuGroup(StartMode mode) const
|
||||||
{ return defaultMenuGroup(mode); }
|
{ return defaultMenuGroup(mode); }
|
||||||
/// Returns a short user readable action name for this tool.
|
/// Returns a short user readable action name for this tool.
|
||||||
virtual QString actionName(StartMode mode) const
|
virtual QString actionName(StartMode mode) const
|
||||||
@@ -102,8 +104,8 @@ public:
|
|||||||
virtual ToolMode toolMode() const = 0;
|
virtual ToolMode toolMode() const = 0;
|
||||||
|
|
||||||
/// Convenience implementation.
|
/// Convenience implementation.
|
||||||
static QByteArray defaultMenuGroup(StartMode mode);
|
static Core::Id defaultMenuGroup(StartMode mode);
|
||||||
static QByteArray defaultActionId(const IAnalyzerTool *tool, StartMode mode);
|
static Core::Id defaultActionId(const IAnalyzerTool *tool, StartMode mode);
|
||||||
static QString defaultActionName(const IAnalyzerTool *tool, StartMode mode);
|
static QString defaultActionName(const IAnalyzerTool *tool, StartMode mode);
|
||||||
|
|
||||||
/// This gets called after all analyzation tools where initialized.
|
/// This gets called after all analyzation tools where initialized.
|
||||||
|
@@ -121,7 +121,7 @@ using namespace Core::Internal;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn QAction *ActionContainer::insertLocation(const QString &group) const
|
\fn QAction *ActionContainer::insertLocation(const Core::Id &group) const
|
||||||
Returns an action representing the \a group,
|
Returns an action representing the \a group,
|
||||||
that could be used with \c{QWidget::insertAction}.
|
that could be used with \c{QWidget::insertAction}.
|
||||||
*/
|
*/
|
||||||
@@ -136,7 +136,7 @@ using namespace Core::Internal;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void ActionContainer::addAction(Core::Command *action, const QString &group)
|
\fn void ActionContainer::addAction(Core::Command *action, const Core::Id &group)
|
||||||
Add the \a action as a menu item to this action container. The action is added as the
|
Add the \a action as a menu item to this action container. The action is added as the
|
||||||
last item of the specified \a group.
|
last item of the specified \a group.
|
||||||
\sa appendGroup()
|
\sa appendGroup()
|
||||||
@@ -144,7 +144,7 @@ using namespace Core::Internal;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void ActionContainer::addMenu(Core::ActionContainer *menu, const QString &group)
|
\fn void ActionContainer::addMenu(Core::ActionContainer *menu, const Core::Id &group)
|
||||||
Add the \a menu as a submenu to this action container. The menu is added as the
|
Add the \a menu as a submenu to this action container. The menu is added as the
|
||||||
last item of the specified \a group.
|
last item of the specified \a group.
|
||||||
\sa appendGroup()
|
\sa appendGroup()
|
||||||
@@ -163,12 +163,12 @@ using namespace Core::Internal;
|
|||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ActionContainerPrivate::ActionContainerPrivate(int id)
|
ActionContainerPrivate::ActionContainerPrivate(Id id)
|
||||||
: m_onAllDisabledBehavior(Disable), m_id(id), m_updateRequested(false)
|
: m_onAllDisabledBehavior(Disable), m_id(id), m_updateRequested(false)
|
||||||
{
|
{
|
||||||
appendGroup(QLatin1String(Constants::G_DEFAULT_ONE));
|
appendGroup(Constants::G_DEFAULT_ONE);
|
||||||
appendGroup(QLatin1String(Constants::G_DEFAULT_TWO));
|
appendGroup(Constants::G_DEFAULT_TWO);
|
||||||
appendGroup(QLatin1String(Constants::G_DEFAULT_THREE));
|
appendGroup(Constants::G_DEFAULT_THREE);
|
||||||
scheduleUpdate();
|
scheduleUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,12 +182,12 @@ ActionContainer::OnAllDisabledBehavior ActionContainerPrivate::onAllDisabledBeha
|
|||||||
return m_onAllDisabledBehavior;
|
return m_onAllDisabledBehavior;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionContainerPrivate::appendGroup(const QString &groupId)
|
void ActionContainerPrivate::appendGroup(const Id &groupId)
|
||||||
{
|
{
|
||||||
m_groups.append(Group(groupId));
|
m_groups.append(Group(groupId));
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<Group>::const_iterator ActionContainerPrivate::findGroup(const QString &groupId) const
|
QList<Group>::const_iterator ActionContainerPrivate::findGroup(const Id &groupId) const
|
||||||
{
|
{
|
||||||
QList<Group>::const_iterator it = m_groups.constBegin();
|
QList<Group>::const_iterator it = m_groups.constBegin();
|
||||||
while (it != m_groups.constEnd()) {
|
while (it != m_groups.constEnd()) {
|
||||||
@@ -199,7 +199,7 @@ QList<Group>::const_iterator ActionContainerPrivate::findGroup(const QString &gr
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QAction *ActionContainerPrivate::insertLocation(const QString &groupId) const
|
QAction *ActionContainerPrivate::insertLocation(const Id &groupId) const
|
||||||
{
|
{
|
||||||
QList<Group>::const_iterator it = findGroup(groupId);
|
QList<Group>::const_iterator it = findGroup(groupId);
|
||||||
QTC_ASSERT(it != m_groups.constEnd(), return 0);
|
QTC_ASSERT(it != m_groups.constEnd(), return 0);
|
||||||
@@ -227,20 +227,15 @@ QAction *ActionContainerPrivate::insertLocation(QList<Group>::const_iterator gro
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionContainerPrivate::addAction(Command *command, const QString &groupId)
|
void ActionContainerPrivate::addAction(Command *command, const Id &groupId)
|
||||||
{
|
{
|
||||||
if (!canAddAction(command))
|
if (!canAddAction(command))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QString actualGroupId;
|
const Id actualGroupId = groupId.isValid() ? groupId : Id(Constants::G_DEFAULT_TWO);
|
||||||
if (groupId.isEmpty())
|
|
||||||
actualGroupId = QLatin1String(Constants::G_DEFAULT_TWO);
|
|
||||||
else
|
|
||||||
actualGroupId = groupId;
|
|
||||||
|
|
||||||
QList<Group>::const_iterator groupIt = findGroup(actualGroupId);
|
QList<Group>::const_iterator groupIt = findGroup(actualGroupId);
|
||||||
QTC_ASSERT(groupIt != m_groups.constEnd(), qDebug() << "Can't find group" << groupId
|
QTC_ASSERT(groupIt != m_groups.constEnd(), qDebug() << "Can't find group"
|
||||||
<< "in container" << id(); return);
|
<< groupId.name() << "in container" << id().name(); return);
|
||||||
QAction *beforeAction = insertLocation(groupIt);
|
QAction *beforeAction = insertLocation(groupIt);
|
||||||
m_groups[groupIt-m_groups.constBegin()].items.append(command);
|
m_groups[groupIt-m_groups.constBegin()].items.append(command);
|
||||||
|
|
||||||
@@ -250,19 +245,14 @@ void ActionContainerPrivate::addAction(Command *command, const QString &groupId)
|
|||||||
scheduleUpdate();
|
scheduleUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionContainerPrivate::addMenu(ActionContainer *menu, const QString &groupId)
|
void ActionContainerPrivate::addMenu(ActionContainer *menu, const Id &groupId)
|
||||||
{
|
{
|
||||||
ActionContainerPrivate *containerPrivate = static_cast<ActionContainerPrivate *>(menu);
|
ActionContainerPrivate *containerPrivate = static_cast<ActionContainerPrivate *>(menu);
|
||||||
if (!containerPrivate->canBeAddedToMenu())
|
if (!containerPrivate->canBeAddedToMenu())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MenuActionContainer *container = static_cast<MenuActionContainer *>(containerPrivate);
|
MenuActionContainer *container = static_cast<MenuActionContainer *>(containerPrivate);
|
||||||
|
const Id actualGroupId = groupId.isValid() ? groupId : Id(Constants::G_DEFAULT_TWO);
|
||||||
QString actualGroupId;
|
|
||||||
if (groupId.isEmpty())
|
|
||||||
actualGroupId = QLatin1String(Constants::G_DEFAULT_TWO);
|
|
||||||
else
|
|
||||||
actualGroupId = groupId;
|
|
||||||
|
|
||||||
QList<Group>::const_iterator groupIt = findGroup(actualGroupId);
|
QList<Group>::const_iterator groupIt = findGroup(actualGroupId);
|
||||||
QTC_ASSERT(groupIt != m_groups.constEnd(), return);
|
QTC_ASSERT(groupIt != m_groups.constEnd(), return);
|
||||||
QAction *beforeAction = insertLocation(groupIt);
|
QAction *beforeAction = insertLocation(groupIt);
|
||||||
@@ -273,19 +263,14 @@ void ActionContainerPrivate::addMenu(ActionContainer *menu, const QString &group
|
|||||||
scheduleUpdate();
|
scheduleUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionContainerPrivate::addMenu(ActionContainer *before, ActionContainer *menu, const QString &groupId)
|
void ActionContainerPrivate::addMenu(ActionContainer *before, ActionContainer *menu, const Id &groupId)
|
||||||
{
|
{
|
||||||
ActionContainerPrivate *containerPrivate = static_cast<ActionContainerPrivate *>(menu);
|
ActionContainerPrivate *containerPrivate = static_cast<ActionContainerPrivate *>(menu);
|
||||||
if (!containerPrivate->canBeAddedToMenu())
|
if (!containerPrivate->canBeAddedToMenu())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MenuActionContainer *container = static_cast<MenuActionContainer *>(containerPrivate);
|
MenuActionContainer *container = static_cast<MenuActionContainer *>(containerPrivate);
|
||||||
|
const Id actualGroupId = groupId.isValid() ? groupId : Id(Constants::G_DEFAULT_TWO);
|
||||||
QString actualGroupId;
|
|
||||||
if (groupId.isEmpty())
|
|
||||||
actualGroupId = QLatin1String(Constants::G_DEFAULT_TWO);
|
|
||||||
else
|
|
||||||
actualGroupId = groupId;
|
|
||||||
|
|
||||||
QList<Group>::const_iterator groupIt = findGroup(actualGroupId);
|
QList<Group>::const_iterator groupIt = findGroup(actualGroupId);
|
||||||
QTC_ASSERT(groupIt != m_groups.constEnd(), return);
|
QTC_ASSERT(groupIt != m_groups.constEnd(), return);
|
||||||
QAction *beforeAction = before->menu()->menuAction();
|
QAction *beforeAction = before->menu()->menuAction();
|
||||||
@@ -328,7 +313,7 @@ void ActionContainerPrivate::itemDestroyed()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int ActionContainerPrivate::id() const
|
Id ActionContainerPrivate::id() const
|
||||||
{
|
{
|
||||||
return m_id;
|
return m_id;
|
||||||
}
|
}
|
||||||
@@ -369,7 +354,7 @@ void ActionContainerPrivate::update()
|
|||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
MenuActionContainer::MenuActionContainer(int id)
|
MenuActionContainer::MenuActionContainer(Id id)
|
||||||
: ActionContainerPrivate(id), m_menu(0)
|
: ActionContainerPrivate(id), m_menu(0)
|
||||||
{
|
{
|
||||||
setOnAllDisabledBehavior(Disable);
|
setOnAllDisabledBehavior(Disable);
|
||||||
@@ -471,7 +456,7 @@ bool MenuActionContainer::canBeAddedToMenu() const
|
|||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
MenuBarActionContainer::MenuBarActionContainer(int id)
|
MenuBarActionContainer::MenuBarActionContainer(Id id)
|
||||||
: ActionContainerPrivate(id), m_menuBar(0)
|
: ActionContainerPrivate(id), m_menuBar(0)
|
||||||
{
|
{
|
||||||
setOnAllDisabledBehavior(Show);
|
setOnAllDisabledBehavior(Show);
|
||||||
|
@@ -33,6 +33,8 @@
|
|||||||
#ifndef ACTIONCONTAINER_H
|
#ifndef ACTIONCONTAINER_H
|
||||||
#define ACTIONCONTAINER_H
|
#define ACTIONCONTAINER_H
|
||||||
|
|
||||||
|
#include "coreplugin/id.h"
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@@ -59,21 +61,20 @@ public:
|
|||||||
virtual void setOnAllDisabledBehavior(OnAllDisabledBehavior behavior) = 0;
|
virtual void setOnAllDisabledBehavior(OnAllDisabledBehavior behavior) = 0;
|
||||||
virtual ActionContainer::OnAllDisabledBehavior onAllDisabledBehavior() const = 0;
|
virtual ActionContainer::OnAllDisabledBehavior onAllDisabledBehavior() const = 0;
|
||||||
|
|
||||||
virtual int id() const = 0;
|
virtual Id id() const = 0;
|
||||||
|
|
||||||
virtual QMenu *menu() const = 0;
|
virtual QMenu *menu() const = 0;
|
||||||
virtual QMenuBar *menuBar() const = 0;
|
virtual QMenuBar *menuBar() const = 0;
|
||||||
|
|
||||||
virtual QAction *insertLocation(const QString &group) const = 0;
|
virtual QAction *insertLocation(const Id &group) const = 0;
|
||||||
virtual void appendGroup(const QString &group) = 0;
|
virtual void appendGroup(const Id &group) = 0;
|
||||||
virtual void addAction(Command *action, const QString &group = QString()) = 0;
|
virtual void addAction(Command *action, const Id &group = Id()) = 0;
|
||||||
virtual void addMenu(ActionContainer *menu, const QString &group = QString()) = 0;
|
virtual void addMenu(ActionContainer *menu, const Id &group = Id()) = 0;
|
||||||
virtual void addMenu(ActionContainer *before, ActionContainer *menu, const QString &group = QString()) = 0;
|
virtual void addMenu(ActionContainer *before, ActionContainer *menu, const Id &group = Id()) = 0;
|
||||||
|
|
||||||
// clears this menu and submenus from all actions and submenus
|
// This clears this menu and submenus from all actions and submenus.
|
||||||
// doesn't destroy the submenus and commands, just removes them from their parents
|
// It does not destroy the submenus and commands, just removes them from their parents.
|
||||||
virtual void clear() = 0;
|
virtual void clear() = 0;
|
||||||
virtual ~ActionContainer() {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Core
|
} // namespace Core
|
||||||
|
@@ -41,9 +41,10 @@
|
|||||||
namespace Core {
|
namespace Core {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
struct Group {
|
struct Group
|
||||||
Group(const QString &id) : id(id) {}
|
{
|
||||||
QString id;
|
Group(const Id &id) : id(id) {}
|
||||||
|
Id id;
|
||||||
QList<QObject *> items; // Command * or ActionContainer *
|
QList<QObject *> items; // Command * or ActionContainer *
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -52,20 +53,20 @@ class ActionContainerPrivate : public Core::ActionContainer
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ActionContainerPrivate(int id);
|
ActionContainerPrivate(Id id);
|
||||||
virtual ~ActionContainerPrivate() {}
|
~ActionContainerPrivate() {}
|
||||||
|
|
||||||
void setOnAllDisabledBehavior(OnAllDisabledBehavior behavior);
|
void setOnAllDisabledBehavior(OnAllDisabledBehavior behavior);
|
||||||
ActionContainer::OnAllDisabledBehavior onAllDisabledBehavior() const;
|
ActionContainer::OnAllDisabledBehavior onAllDisabledBehavior() const;
|
||||||
|
|
||||||
QAction *insertLocation(const QString &group) const;
|
QAction *insertLocation(const Id &groupId) const;
|
||||||
void appendGroup(const QString &id);
|
void appendGroup(const Id &id);
|
||||||
void addAction(Command *action, const QString &group = QString());
|
void addAction(Command *action, const Id &group = Id());
|
||||||
void addMenu(ActionContainer *menu, const QString &group = QString());
|
void addMenu(ActionContainer *menu, const Id &group = Id());
|
||||||
void addMenu(ActionContainer *before, ActionContainer *menu, const QString &group = QString());
|
void addMenu(ActionContainer *before, ActionContainer *menu, const Id &group = Id());
|
||||||
virtual void clear();
|
virtual void clear();
|
||||||
|
|
||||||
int id() const;
|
Id id() const;
|
||||||
|
|
||||||
QMenu *menu() const;
|
QMenu *menu() const;
|
||||||
QMenuBar *menuBar() const;
|
QMenuBar *menuBar() const;
|
||||||
@@ -92,18 +93,18 @@ private slots:
|
|||||||
void itemDestroyed();
|
void itemDestroyed();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<Group>::const_iterator findGroup(const QString &groupId) const;
|
QList<Group>::const_iterator findGroup(const Id &groupId) const;
|
||||||
QAction *insertLocation(QList<Group>::const_iterator group) const;
|
QAction *insertLocation(QList<Group>::const_iterator group) const;
|
||||||
|
|
||||||
OnAllDisabledBehavior m_onAllDisabledBehavior;
|
OnAllDisabledBehavior m_onAllDisabledBehavior;
|
||||||
int m_id;
|
Id m_id;
|
||||||
bool m_updateRequested;
|
bool m_updateRequested;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MenuActionContainer : public ActionContainerPrivate
|
class MenuActionContainer : public ActionContainerPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MenuActionContainer(int id);
|
explicit MenuActionContainer(Id id);
|
||||||
|
|
||||||
void setMenu(QMenu *menu);
|
void setMenu(QMenu *menu);
|
||||||
QMenu *menu() const;
|
QMenu *menu() const;
|
||||||
@@ -125,7 +126,7 @@ private:
|
|||||||
class MenuBarActionContainer : public ActionContainerPrivate
|
class MenuBarActionContainer : public ActionContainerPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MenuBarActionContainer(int id);
|
explicit MenuBarActionContainer(Id id);
|
||||||
|
|
||||||
void setMenuBar(QMenuBar *menuBar);
|
void setMenuBar(QMenuBar *menuBar);
|
||||||
QMenuBar *menuBar() const;
|
QMenuBar *menuBar() const;
|
||||||
|
@@ -306,18 +306,17 @@ bool ActionManagerPrivate::hasContext(const Context &context) const
|
|||||||
|
|
||||||
ActionContainer *ActionManagerPrivate::createMenu(const Id &id)
|
ActionContainer *ActionManagerPrivate::createMenu(const Id &id)
|
||||||
{
|
{
|
||||||
const int uid = id.uniqueIdentifier();
|
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(id);
|
||||||
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
|
|
||||||
if (it != m_idContainerMap.constEnd())
|
if (it != m_idContainerMap.constEnd())
|
||||||
return it.value();
|
return it.value();
|
||||||
|
|
||||||
QMenu *m = new QMenu(m_mainWnd);
|
QMenu *m = new QMenu(m_mainWnd);
|
||||||
m->setObjectName(id.name());
|
m->setObjectName(id.name());
|
||||||
|
|
||||||
MenuActionContainer *mc = new MenuActionContainer(uid);
|
MenuActionContainer *mc = new MenuActionContainer(id);
|
||||||
mc->setMenu(m);
|
mc->setMenu(m);
|
||||||
|
|
||||||
m_idContainerMap.insert(uid, mc);
|
m_idContainerMap.insert(id, mc);
|
||||||
connect(mc, SIGNAL(destroyed()), this, SLOT(containerDestroyed()));
|
connect(mc, SIGNAL(destroyed()), this, SLOT(containerDestroyed()));
|
||||||
|
|
||||||
return mc;
|
return mc;
|
||||||
@@ -325,18 +324,17 @@ ActionContainer *ActionManagerPrivate::createMenu(const Id &id)
|
|||||||
|
|
||||||
ActionContainer *ActionManagerPrivate::createMenuBar(const Id &id)
|
ActionContainer *ActionManagerPrivate::createMenuBar(const Id &id)
|
||||||
{
|
{
|
||||||
const int uid = id.uniqueIdentifier();
|
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(id);
|
||||||
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
|
|
||||||
if (it != m_idContainerMap.constEnd())
|
if (it != m_idContainerMap.constEnd())
|
||||||
return it.value();
|
return it.value();
|
||||||
|
|
||||||
QMenuBar *mb = new QMenuBar; // No parent (System menu bar on Mac OS X)
|
QMenuBar *mb = new QMenuBar; // No parent (System menu bar on Mac OS X)
|
||||||
mb->setObjectName(id.toString());
|
mb->setObjectName(id.toString());
|
||||||
|
|
||||||
MenuBarActionContainer *mbc = new MenuBarActionContainer(uid);
|
MenuBarActionContainer *mbc = new MenuBarActionContainer(id);
|
||||||
mbc->setMenuBar(mb);
|
mbc->setMenuBar(mb);
|
||||||
|
|
||||||
m_idContainerMap.insert(uid, mbc);
|
m_idContainerMap.insert(id, mbc);
|
||||||
connect(mbc, SIGNAL(destroyed()), this, SLOT(containerDestroyed()));
|
connect(mbc, SIGNAL(destroyed()), this, SLOT(containerDestroyed()));
|
||||||
|
|
||||||
return mbc;
|
return mbc;
|
||||||
@@ -392,8 +390,7 @@ Command *ActionManagerPrivate::registerAction(QAction *action, const Id &id, con
|
|||||||
Action *ActionManagerPrivate::overridableAction(const Id &id)
|
Action *ActionManagerPrivate::overridableAction(const Id &id)
|
||||||
{
|
{
|
||||||
Action *a = 0;
|
Action *a = 0;
|
||||||
const int uid = id.uniqueIdentifier();
|
if (CommandPrivate *c = m_idCmdMap.value(id, 0)) {
|
||||||
if (CommandPrivate *c = m_idCmdMap.value(uid, 0)) {
|
|
||||||
a = qobject_cast<Action *>(c);
|
a = qobject_cast<Action *>(c);
|
||||||
if (!a) {
|
if (!a) {
|
||||||
qWarning() << "registerAction: id" << id.name()
|
qWarning() << "registerAction: id" << id.name()
|
||||||
@@ -401,8 +398,8 @@ Action *ActionManagerPrivate::overridableAction(const Id &id)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
a = new Action(uid);
|
a = new Action(id);
|
||||||
m_idCmdMap.insert(uid, a);
|
m_idCmdMap.insert(id, a);
|
||||||
m_mainWnd->addAction(a->action());
|
m_mainWnd->addAction(a->action());
|
||||||
a->action()->setObjectName(id.toString());
|
a->action()->setObjectName(id.toString());
|
||||||
a->action()->setShortcutContext(Qt::ApplicationShortcut);
|
a->action()->setShortcutContext(Qt::ApplicationShortcut);
|
||||||
@@ -418,8 +415,7 @@ Action *ActionManagerPrivate::overridableAction(const Id &id)
|
|||||||
void ActionManagerPrivate::unregisterAction(QAction *action, const Id &id)
|
void ActionManagerPrivate::unregisterAction(QAction *action, const Id &id)
|
||||||
{
|
{
|
||||||
Action *a = 0;
|
Action *a = 0;
|
||||||
const int uid = id.uniqueIdentifier();
|
CommandPrivate *c = m_idCmdMap.value(id, 0);
|
||||||
CommandPrivate *c = m_idCmdMap.value(uid, 0);
|
|
||||||
QTC_ASSERT(c, return);
|
QTC_ASSERT(c, return);
|
||||||
a = qobject_cast<Action *>(c);
|
a = qobject_cast<Action *>(c);
|
||||||
if (!a) {
|
if (!a) {
|
||||||
@@ -433,7 +429,7 @@ void ActionManagerPrivate::unregisterAction(QAction *action, const Id &id)
|
|||||||
// ActionContainers listen to the commands' destroyed signals
|
// ActionContainers listen to the commands' destroyed signals
|
||||||
m_mainWnd->removeAction(a->action());
|
m_mainWnd->removeAction(a->action());
|
||||||
delete a->action();
|
delete a->action();
|
||||||
m_idCmdMap.remove(uid);
|
m_idCmdMap.remove(id);
|
||||||
delete a;
|
delete a;
|
||||||
}
|
}
|
||||||
emit commandListChanged();
|
emit commandListChanged();
|
||||||
@@ -442,8 +438,7 @@ void ActionManagerPrivate::unregisterAction(QAction *action, const Id &id)
|
|||||||
Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const Id &id, const Context &context, bool scriptable)
|
Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const Id &id, const Context &context, bool scriptable)
|
||||||
{
|
{
|
||||||
Shortcut *sc = 0;
|
Shortcut *sc = 0;
|
||||||
const int uid = id.uniqueIdentifier();
|
if (CommandPrivate *c = m_idCmdMap.value(id, 0)) {
|
||||||
if (CommandPrivate *c = m_idCmdMap.value(uid, 0)) {
|
|
||||||
sc = qobject_cast<Shortcut *>(c);
|
sc = qobject_cast<Shortcut *>(c);
|
||||||
if (!sc) {
|
if (!sc) {
|
||||||
qWarning() << "registerShortcut: id" << id.name()
|
qWarning() << "registerShortcut: id" << id.name()
|
||||||
@@ -451,8 +446,8 @@ Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const Id &i
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sc = new Shortcut(uid);
|
sc = new Shortcut(id);
|
||||||
m_idCmdMap.insert(uid, sc);
|
m_idCmdMap.insert(id, sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sc->shortcut()) {
|
if (sc->shortcut()) {
|
||||||
@@ -482,12 +477,11 @@ Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const Id &i
|
|||||||
|
|
||||||
Command *ActionManagerPrivate::command(const Id &id) const
|
Command *ActionManagerPrivate::command(const Id &id) const
|
||||||
{
|
{
|
||||||
const int uid = id.uniqueIdentifier();
|
const IdCmdMap::const_iterator it = m_idCmdMap.constFind(id);
|
||||||
const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid);
|
|
||||||
if (it == m_idCmdMap.constEnd()) {
|
if (it == m_idCmdMap.constEnd()) {
|
||||||
if (warnAboutFindFailures)
|
if (warnAboutFindFailures)
|
||||||
qWarning() << "ActionManagerPrivate::command(): failed to find :"
|
qWarning() << "ActionManagerPrivate::command(): failed to find :"
|
||||||
<< id.name() << '/' << uid;
|
<< id.name();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return it.value();
|
return it.value();
|
||||||
@@ -495,36 +489,11 @@ Command *ActionManagerPrivate::command(const Id &id) const
|
|||||||
|
|
||||||
ActionContainer *ActionManagerPrivate::actionContainer(const Id &id) const
|
ActionContainer *ActionManagerPrivate::actionContainer(const Id &id) const
|
||||||
{
|
{
|
||||||
const int uid = id.uniqueIdentifier();
|
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(id);
|
||||||
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
|
|
||||||
if (it == m_idContainerMap.constEnd()) {
|
if (it == m_idContainerMap.constEnd()) {
|
||||||
if (warnAboutFindFailures)
|
if (warnAboutFindFailures)
|
||||||
qWarning() << "ActionManagerPrivate::actionContainer(): failed to find :"
|
qWarning() << "ActionManagerPrivate::actionContainer(): failed to find :"
|
||||||
<< id.name() << '/' << uid;
|
<< id.name();
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return it.value();
|
|
||||||
}
|
|
||||||
|
|
||||||
Command *ActionManagerPrivate::command(int uid) const
|
|
||||||
{
|
|
||||||
const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid);
|
|
||||||
if (it == m_idCmdMap.constEnd()) {
|
|
||||||
if (warnAboutFindFailures)
|
|
||||||
qWarning() << "ActionManagerPrivate::command(): failed to find :"
|
|
||||||
<< Id::fromUniqueIdentifier(uid).toString() << '/' << uid;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return it.value();
|
|
||||||
}
|
|
||||||
|
|
||||||
ActionContainer *ActionManagerPrivate::actionContainer(int uid) const
|
|
||||||
{
|
|
||||||
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
|
|
||||||
if (it == m_idContainerMap.constEnd()) {
|
|
||||||
if (warnAboutFindFailures)
|
|
||||||
qWarning() << "ActionManagerPrivate::actionContainer(): failed to find :"
|
|
||||||
<< Id::fromUniqueIdentifier(uid).toString() << uid;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return it.value();
|
return it.value();
|
||||||
@@ -540,9 +509,8 @@ void ActionManagerPrivate::initialize()
|
|||||||
const int shortcuts = settings->beginReadArray(QLatin1String(settingsGroup));
|
const int shortcuts = settings->beginReadArray(QLatin1String(settingsGroup));
|
||||||
for (int i = 0; i < shortcuts; ++i) {
|
for (int i = 0; i < shortcuts; ++i) {
|
||||||
settings->setArrayIndex(i);
|
settings->setArrayIndex(i);
|
||||||
const QString sid = settings->value(QLatin1String(idKey)).toString();
|
|
||||||
const QKeySequence key(settings->value(QLatin1String(sequenceKey)).toString());
|
const QKeySequence key(settings->value(QLatin1String(sequenceKey)).toString());
|
||||||
const int id = Id(sid).uniqueIdentifier();
|
const Id id = Id(settings->value(QLatin1String(idKey)).toString());
|
||||||
|
|
||||||
Command *cmd = command(id);
|
Command *cmd = command(id);
|
||||||
if (cmd)
|
if (cmd)
|
||||||
@@ -558,13 +526,12 @@ void ActionManagerPrivate::saveSettings(QSettings *settings)
|
|||||||
|
|
||||||
const IdCmdMap::const_iterator cmdcend = m_idCmdMap.constEnd();
|
const IdCmdMap::const_iterator cmdcend = m_idCmdMap.constEnd();
|
||||||
for (IdCmdMap::const_iterator j = m_idCmdMap.constBegin(); j != cmdcend; ++j) {
|
for (IdCmdMap::const_iterator j = m_idCmdMap.constBegin(); j != cmdcend; ++j) {
|
||||||
const int id = j.key();
|
const Id id = j.key();
|
||||||
CommandPrivate *cmd = j.value();
|
CommandPrivate *cmd = j.value();
|
||||||
QKeySequence key = cmd->keySequence();
|
QKeySequence key = cmd->keySequence();
|
||||||
if (key != cmd->defaultKeySequence()) {
|
if (key != cmd->defaultKeySequence()) {
|
||||||
const QString sid = Id::fromUniqueIdentifier(id).toString();
|
|
||||||
settings->setArrayIndex(count);
|
settings->setArrayIndex(count);
|
||||||
settings->setValue(QLatin1String(idKey), sid);
|
settings->setValue(QLatin1String(idKey), id.toString());
|
||||||
settings->setValue(QLatin1String(sequenceKey), key.toString());
|
settings->setValue(QLatin1String(sequenceKey), key.toString());
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@@ -576,8 +543,7 @@ void ActionManagerPrivate::saveSettings(QSettings *settings)
|
|||||||
void ActionManagerPrivate::unregisterShortcut(const Core::Id &id)
|
void ActionManagerPrivate::unregisterShortcut(const Core::Id &id)
|
||||||
{
|
{
|
||||||
Shortcut *sc = 0;
|
Shortcut *sc = 0;
|
||||||
const int uid = id.uniqueIdentifier();
|
CommandPrivate *c = m_idCmdMap.value(id, 0);
|
||||||
CommandPrivate *c = m_idCmdMap.value(uid, 0);
|
|
||||||
QTC_ASSERT(c, return);
|
QTC_ASSERT(c, return);
|
||||||
sc = qobject_cast<Shortcut *>(c);
|
sc = qobject_cast<Shortcut *>(c);
|
||||||
if (!sc) {
|
if (!sc) {
|
||||||
@@ -586,7 +552,7 @@ void ActionManagerPrivate::unregisterShortcut(const Core::Id &id)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
delete sc->shortcut();
|
delete sc->shortcut();
|
||||||
m_idCmdMap.remove(uid);
|
m_idCmdMap.remove(id);
|
||||||
delete sc;
|
delete sc;
|
||||||
emit commandListChanged();
|
emit commandListChanged();
|
||||||
}
|
}
|
||||||
|
@@ -34,8 +34,7 @@
|
|||||||
#define ACTIONMANAGERPRIVATE_H
|
#define ACTIONMANAGERPRIVATE_H
|
||||||
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include "command_p.h"
|
#include <coreplugin/actionmanager/command_p.h>
|
||||||
|
|
||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
|
|
||||||
#include <QtCore/QMap>
|
#include <QtCore/QMap>
|
||||||
@@ -63,21 +62,19 @@ public:
|
|||||||
explicit ActionManagerPrivate(MainWindow *mainWnd);
|
explicit ActionManagerPrivate(MainWindow *mainWnd);
|
||||||
~ActionManagerPrivate();
|
~ActionManagerPrivate();
|
||||||
|
|
||||||
void setContext(const Context &context);
|
|
||||||
static ActionManagerPrivate *instance();
|
static ActionManagerPrivate *instance();
|
||||||
|
|
||||||
|
void initialize();
|
||||||
|
|
||||||
|
void setContext(const Context &context);
|
||||||
|
bool hasContext(int context) const;
|
||||||
|
|
||||||
void saveSettings(QSettings *settings);
|
void saveSettings(QSettings *settings);
|
||||||
|
|
||||||
QList<Command *> commands() const;
|
QList<Command *> commands() const;
|
||||||
|
|
||||||
bool hasContext(int context) const;
|
Command *command(const Id &id) const;
|
||||||
|
ActionContainer *actionContainer(const Id &id) const;
|
||||||
Command *command(int uid) const;
|
|
||||||
ActionContainer *actionContainer(int uid) const;
|
|
||||||
|
|
||||||
void initialize();
|
|
||||||
|
|
||||||
//ActionManager Interface
|
|
||||||
ActionContainer *createMenu(const Id &id);
|
ActionContainer *createMenu(const Id &id);
|
||||||
ActionContainer *createMenuBar(const Id &id);
|
ActionContainer *createMenuBar(const Id &id);
|
||||||
|
|
||||||
@@ -86,8 +83,6 @@ public:
|
|||||||
Command *registerShortcut(QShortcut *shortcut, const Id &id,
|
Command *registerShortcut(QShortcut *shortcut, const Id &id,
|
||||||
const Context &context, bool scriptable = false);
|
const Context &context, bool scriptable = false);
|
||||||
|
|
||||||
Core::Command *command(const Id &id) const;
|
|
||||||
Core::ActionContainer *actionContainer(const Id &id) const;
|
|
||||||
void unregisterAction(QAction *action, const Id &id);
|
void unregisterAction(QAction *action, const Id &id);
|
||||||
void unregisterShortcut(const Id &id);
|
void unregisterShortcut(const Id &id);
|
||||||
|
|
||||||
@@ -106,10 +101,10 @@ private:
|
|||||||
|
|
||||||
static ActionManagerPrivate *m_instance;
|
static ActionManagerPrivate *m_instance;
|
||||||
|
|
||||||
typedef QHash<int, CommandPrivate *> IdCmdMap;
|
typedef QHash<Core::Id, CommandPrivate *> IdCmdMap;
|
||||||
IdCmdMap m_idCmdMap;
|
IdCmdMap m_idCmdMap;
|
||||||
|
|
||||||
typedef QHash<int, ActionContainerPrivate *> IdContainerMap;
|
typedef QHash<Core::Id, ActionContainerPrivate *> IdContainerMap;
|
||||||
IdContainerMap m_idContainerMap;
|
IdContainerMap m_idContainerMap;
|
||||||
|
|
||||||
// typedef QMap<int, int> GlobalGroupMap;
|
// typedef QMap<int, int> GlobalGroupMap;
|
||||||
|
@@ -208,6 +208,7 @@
|
|||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
using namespace Core;
|
||||||
using namespace Core::Internal;
|
using namespace Core::Internal;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -215,7 +216,7 @@ using namespace Core::Internal;
|
|||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CommandPrivate::CommandPrivate(int id)
|
CommandPrivate::CommandPrivate(Id id)
|
||||||
: m_attributes(0), m_id(id), m_isKeyInitialized(false)
|
: m_attributes(0), m_id(id), m_isKeyInitialized(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -248,7 +249,7 @@ QString CommandPrivate::defaultText() const
|
|||||||
return m_defaultText;
|
return m_defaultText;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CommandPrivate::id() const
|
Id CommandPrivate::id() const
|
||||||
{
|
{
|
||||||
return m_id;
|
return m_id;
|
||||||
}
|
}
|
||||||
@@ -295,11 +296,9 @@ QString CommandPrivate::stringWithAppendedShortcut(const QString &str) const
|
|||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Shortcut::Shortcut(int id)
|
Shortcut::Shortcut(Id id)
|
||||||
: CommandPrivate(id), m_shortcut(0), m_scriptable(false)
|
: CommandPrivate(id), m_shortcut(0), m_scriptable(false)
|
||||||
{
|
{}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Shortcut::setShortcut(QShortcut *shortcut)
|
void Shortcut::setShortcut(QShortcut *shortcut)
|
||||||
{
|
{
|
||||||
@@ -387,7 +386,7 @@ void Shortcut::setScriptable(bool value)
|
|||||||
\class Action
|
\class Action
|
||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
Action::Action(int id)
|
Action::Action(Id id)
|
||||||
: CommandPrivate(id),
|
: CommandPrivate(id),
|
||||||
m_action(new Utils::ProxyAction(this)),
|
m_action(new Utils::ProxyAction(this)),
|
||||||
m_active(false),
|
m_active(false),
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
#define COMMAND_H
|
#define COMMAND_H
|
||||||
|
|
||||||
#include <coreplugin/core_global.h>
|
#include <coreplugin/core_global.h>
|
||||||
|
#include <coreplugin/id.h>
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
@@ -66,7 +67,7 @@ public:
|
|||||||
virtual void setDefaultText(const QString &text) = 0;
|
virtual void setDefaultText(const QString &text) = 0;
|
||||||
virtual QString defaultText() const = 0;
|
virtual QString defaultText() const = 0;
|
||||||
|
|
||||||
virtual int id() const = 0;
|
virtual Id id() const = 0;
|
||||||
|
|
||||||
virtual QAction *action() const = 0;
|
virtual QAction *action() const = 0;
|
||||||
virtual QShortcut *shortcut() const = 0;
|
virtual QShortcut *shortcut() const = 0;
|
||||||
@@ -78,10 +79,7 @@ public:
|
|||||||
|
|
||||||
virtual bool isActive() const = 0;
|
virtual bool isActive() const = 0;
|
||||||
|
|
||||||
virtual ~Command() {}
|
|
||||||
|
|
||||||
virtual void setKeySequence(const QKeySequence &key) = 0;
|
virtual void setKeySequence(const QKeySequence &key) = 0;
|
||||||
|
|
||||||
virtual QString stringWithAppendedShortcut(const QString &str) const = 0;
|
virtual QString stringWithAppendedShortcut(const QString &str) const = 0;
|
||||||
|
|
||||||
virtual bool isScriptable() const = 0;
|
virtual bool isScriptable() const = 0;
|
||||||
|
@@ -35,9 +35,11 @@
|
|||||||
|
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
|
|
||||||
#include <utils/proxyaction.h>
|
#include <coreplugin/id.h>
|
||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
|
|
||||||
|
#include <utils/proxyaction.h>
|
||||||
|
|
||||||
#include <QtCore/QList>
|
#include <QtCore/QList>
|
||||||
#include <QtCore/QMultiMap>
|
#include <QtCore/QMultiMap>
|
||||||
#include <QtCore/QPointer>
|
#include <QtCore/QPointer>
|
||||||
@@ -51,7 +53,7 @@ class CommandPrivate : public Core::Command
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
CommandPrivate(int id);
|
CommandPrivate(Id id);
|
||||||
virtual ~CommandPrivate() {}
|
virtual ~CommandPrivate() {}
|
||||||
|
|
||||||
void setDefaultKeySequence(const QKeySequence &key);
|
void setDefaultKeySequence(const QKeySequence &key);
|
||||||
@@ -62,7 +64,7 @@ public:
|
|||||||
void setDefaultText(const QString &text);
|
void setDefaultText(const QString &text);
|
||||||
QString defaultText() const;
|
QString defaultText() const;
|
||||||
|
|
||||||
int id() const;
|
Id id() const;
|
||||||
|
|
||||||
QAction *action() const;
|
QAction *action() const;
|
||||||
QShortcut *shortcut() const;
|
QShortcut *shortcut() const;
|
||||||
@@ -80,7 +82,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
Context m_context;
|
Context m_context;
|
||||||
CommandAttributes m_attributes;
|
CommandAttributes m_attributes;
|
||||||
int m_id;
|
Id m_id;
|
||||||
QKeySequence m_defaultKey;
|
QKeySequence m_defaultKey;
|
||||||
QString m_defaultText;
|
QString m_defaultText;
|
||||||
bool m_isKeyInitialized;
|
bool m_isKeyInitialized;
|
||||||
@@ -90,7 +92,7 @@ class Shortcut : public CommandPrivate
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
Shortcut(int id);
|
Shortcut(Id id);
|
||||||
|
|
||||||
void setKeySequence(const QKeySequence &key);
|
void setKeySequence(const QKeySequence &key);
|
||||||
QKeySequence keySequence() const;
|
QKeySequence keySequence() const;
|
||||||
@@ -121,7 +123,7 @@ class Action : public CommandPrivate
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
Action(int id);
|
Action(Id id);
|
||||||
|
|
||||||
void setKeySequence(const QKeySequence &key);
|
void setKeySequence(const QKeySequence &key);
|
||||||
QKeySequence keySequence() const;
|
QKeySequence keySequence() const;
|
||||||
|
@@ -148,7 +148,7 @@ bool CommandsFile::exportCommands(const QList<ShortcutItem *> &items)
|
|||||||
QDateTime::currentDateTime().toString(Qt::ISODate)));
|
QDateTime::currentDateTime().toString(Qt::ISODate)));
|
||||||
w.writeStartElement(ctx.mappingElement);
|
w.writeStartElement(ctx.mappingElement);
|
||||||
foreach (const ShortcutItem *item, items) {
|
foreach (const ShortcutItem *item, items) {
|
||||||
const Id id = Id::fromUniqueIdentifier(item->m_cmd->id());
|
const Id id = item->m_cmd->id();
|
||||||
if (item->m_key.isEmpty()) {
|
if (item->m_key.isEmpty()) {
|
||||||
w.writeEmptyElement(ctx.shortCutElement);
|
w.writeEmptyElement(ctx.shortCutElement);
|
||||||
w.writeAttribute(ctx.idAttribute, id.toString());
|
w.writeAttribute(ctx.idAttribute, id.toString());
|
||||||
|
@@ -227,7 +227,7 @@ void ShortcutSettings::importAction()
|
|||||||
QMap<QString, QKeySequence> mapping = cf.importCommands();
|
QMap<QString, QKeySequence> mapping = cf.importCommands();
|
||||||
|
|
||||||
foreach (ShortcutItem *item, m_scitems) {
|
foreach (ShortcutItem *item, m_scitems) {
|
||||||
QString sid = Id::fromUniqueIdentifier(item->m_cmd->id()).toString();
|
QString sid = item->m_cmd->id().toString();
|
||||||
if (mapping.contains(sid)) {
|
if (mapping.contains(sid)) {
|
||||||
item->m_key = mapping.value(sid);
|
item->m_key = mapping.value(sid);
|
||||||
item->m_item->setText(2, item->m_key);
|
item->m_item->setText(2, item->m_key);
|
||||||
@@ -307,7 +307,7 @@ void ShortcutSettings::initialize()
|
|||||||
s->m_cmd = c;
|
s->m_cmd = c;
|
||||||
s->m_item = item;
|
s->m_item = item;
|
||||||
|
|
||||||
const QString identifier = Id::fromUniqueIdentifier(c->id()).toString();
|
const QString identifier = c->id().toString();
|
||||||
int pos = identifier.indexOf(QLatin1Char('.'));
|
int pos = identifier.indexOf(QLatin1Char('.'));
|
||||||
const QString section = identifier.left(pos);
|
const QString section = identifier.left(pos);
|
||||||
const QString subId = identifier.mid(pos + 1);
|
const QString subId = identifier.mid(pos + 1);
|
||||||
|
@@ -132,12 +132,12 @@ static inline QIcon designerIcon(const QString &iconName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create a menu separator
|
// Create a menu separator
|
||||||
static inline QAction *createSeparator(QObject *parent,
|
static QAction *createSeparator(QObject *parent,
|
||||||
Core::ActionManager *am,
|
Core::ActionManager *am,
|
||||||
const Core::Context &context,
|
const Core::Context &context,
|
||||||
Core::ActionContainer *container,
|
Core::ActionContainer *container,
|
||||||
const Core::Id &id,
|
const Core::Id &id,
|
||||||
const QString &group = QString())
|
const Core::Id &group = Core::Id())
|
||||||
{
|
{
|
||||||
QAction *actSeparator = new QAction(parent);
|
QAction *actSeparator = new QAction(parent);
|
||||||
actSeparator->setSeparator(true);
|
actSeparator->setSeparator(true);
|
||||||
|
@@ -390,7 +390,7 @@ void FakeVimExCommandsPage::initialize()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
QTreeWidgetItem *item = new QTreeWidgetItem;
|
QTreeWidgetItem *item = new QTreeWidgetItem;
|
||||||
const QString name = Id::fromUniqueIdentifier(c->id()).toString();
|
const QString name = c->id().toString();
|
||||||
const int pos = name.indexOf(QLatin1Char('.'));
|
const int pos = name.indexOf(QLatin1Char('.'));
|
||||||
const QString section = name.left(pos);
|
const QString section = name.left(pos);
|
||||||
const QString subId = name.mid(pos + 1);
|
const QString subId = name.mid(pos + 1);
|
||||||
|
@@ -73,7 +73,7 @@ ActionMacroHandler::ActionMacroHandler():
|
|||||||
QList<Core::Command *> commands = am->commands();
|
QList<Core::Command *> commands = am->commands();
|
||||||
foreach (Core::Command *command, commands) {
|
foreach (Core::Command *command, commands) {
|
||||||
if (command->isScriptable()) {
|
if (command->isScriptable()) {
|
||||||
QString id = Core::Id::fromUniqueIdentifier(command->id()).toString();
|
QString id = command->id().toString();
|
||||||
registerCommand(id);
|
registerCommand(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -870,7 +870,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
|||||||
d->m_projectTreeCollapseAllAction = new QAction(tr("Collapse All"), this);
|
d->m_projectTreeCollapseAllAction = new QAction(tr("Collapse All"), this);
|
||||||
cmd = am->registerAction(d->m_projectTreeCollapseAllAction, Constants::PROJECTTREE_COLLAPSE_ALL,
|
cmd = am->registerAction(d->m_projectTreeCollapseAllAction, Constants::PROJECTTREE_COLLAPSE_ALL,
|
||||||
projecTreeContext);
|
projecTreeContext);
|
||||||
const QString treeGroup = QLatin1String(Constants::G_PROJECT_TREE);
|
const Core::Id treeGroup = Constants::G_PROJECT_TREE;
|
||||||
mfileContextMenu->addAction(treeSpacer, treeGroup);
|
mfileContextMenu->addAction(treeSpacer, treeGroup);
|
||||||
mfileContextMenu->addAction(cmd, treeGroup);
|
mfileContextMenu->addAction(cmd, treeGroup);
|
||||||
msubProjectContextMenu->addAction(treeSpacer, treeGroup);
|
msubProjectContextMenu->addAction(treeSpacer, treeGroup);
|
||||||
|
@@ -126,7 +126,7 @@ RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfigurat
|
|||||||
QTC_ASSERT(false, return 0);
|
QTC_ASSERT(false, return 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
IAnalyzerTool *tool = AnalyzerManager::toolFromId(mode.toLatin1());
|
IAnalyzerTool *tool = AnalyzerManager::toolFromId(Core::Id(mode));
|
||||||
AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, runConfiguration);
|
AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, runConfiguration);
|
||||||
QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt()));
|
QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt()));
|
||||||
return rc;
|
return rc;
|
||||||
|
@@ -150,7 +150,7 @@ QmlProfilerTool::~QmlProfilerTool()
|
|||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray QmlProfilerTool::id() const
|
Core::Id QmlProfilerTool::id() const
|
||||||
{
|
{
|
||||||
return "QmlProfiler";
|
return "QmlProfiler";
|
||||||
}
|
}
|
||||||
@@ -566,7 +566,7 @@ static void startRemoteTool(IAnalyzerTool *tool, StartMode mode)
|
|||||||
AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, 0);
|
AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, 0);
|
||||||
QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt()));
|
QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt()));
|
||||||
|
|
||||||
ProjectExplorerPlugin::instance()->startRunControl(rc, tool->id());
|
ProjectExplorerPlugin::instance()->startRunControl(rc, tool->id().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlProfilerTool::tryToConnect()
|
void QmlProfilerTool::tryToConnect()
|
||||||
@@ -657,7 +657,7 @@ void QmlProfilerTool::startTool(StartMode mode)
|
|||||||
ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance();
|
ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance();
|
||||||
// ### not sure if we're supposed to check if the RunConFiguration isEnabled
|
// ### not sure if we're supposed to check if the RunConFiguration isEnabled
|
||||||
Project *pro = pe->startupProject();
|
Project *pro = pe->startupProject();
|
||||||
pe->runProject(pro, id());
|
pe->runProject(pro, id().toString());
|
||||||
} else if (mode == StartRemote) {
|
} else if (mode == StartRemote) {
|
||||||
startRemoteTool(this, mode);
|
startRemoteTool(this, mode);
|
||||||
}
|
}
|
||||||
|
@@ -51,7 +51,7 @@ public:
|
|||||||
explicit QmlProfilerTool(QObject *parent);
|
explicit QmlProfilerTool(QObject *parent);
|
||||||
~QmlProfilerTool();
|
~QmlProfilerTool();
|
||||||
|
|
||||||
QByteArray id() const;
|
Core::Id id() const;
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
QString description() const;
|
QString description() const;
|
||||||
ToolMode toolMode() const;
|
ToolMode toolMode() const;
|
||||||
|
@@ -513,7 +513,7 @@ CallgrindTool::~CallgrindTool()
|
|||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray CallgrindTool::id() const
|
Core::Id CallgrindTool::id() const
|
||||||
{
|
{
|
||||||
return "Callgrind";
|
return "Callgrind";
|
||||||
}
|
}
|
||||||
|
@@ -48,7 +48,7 @@ public:
|
|||||||
CallgrindTool(QObject *parent);
|
CallgrindTool(QObject *parent);
|
||||||
~CallgrindTool();
|
~CallgrindTool();
|
||||||
|
|
||||||
QByteArray id() const;
|
Core::Id id() const;
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
QString description() const;
|
QString description() const;
|
||||||
ToolMode toolMode() const;
|
ToolMode toolMode() const;
|
||||||
|
@@ -285,7 +285,7 @@ void MemcheckTool::maybeActiveRunConfigurationChanged()
|
|||||||
m_errorProxyModel->setFilterExternalIssues(memcheckSettings->filterExternalIssues());
|
m_errorProxyModel->setFilterExternalIssues(memcheckSettings->filterExternalIssues());
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray MemcheckTool::id() const
|
Core::Id MemcheckTool::id() const
|
||||||
{
|
{
|
||||||
return "Memcheck";
|
return "Memcheck";
|
||||||
}
|
}
|
||||||
|
@@ -93,7 +93,7 @@ class MemcheckTool : public Analyzer::IAnalyzerTool
|
|||||||
public:
|
public:
|
||||||
MemcheckTool(QObject *parent);
|
MemcheckTool(QObject *parent);
|
||||||
|
|
||||||
QByteArray id() const;
|
Core::Id id() const;
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
QString description() const;
|
QString description() const;
|
||||||
|
|
||||||
|
@@ -128,7 +128,7 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration
|
|||||||
sp.startMode = StartRemote;
|
sp.startMode = StartRemote;
|
||||||
}
|
}
|
||||||
|
|
||||||
IAnalyzerTool *tool = AnalyzerManager::toolFromId(mode.toLatin1());
|
IAnalyzerTool *tool = AnalyzerManager::toolFromId(Core::Id(mode));
|
||||||
AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, runConfiguration);
|
AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, runConfiguration);
|
||||||
QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt()));
|
QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt()));
|
||||||
return rc;
|
return rc;
|
||||||
@@ -185,7 +185,7 @@ static void startRemoteTool(IAnalyzerTool *tool, StartMode mode)
|
|||||||
//m_currentRunControl = rc;
|
//m_currentRunControl = rc;
|
||||||
QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt()));
|
QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt()));
|
||||||
|
|
||||||
ProjectExplorerPlugin::instance()->startRunControl(rc, tool->id());
|
ProjectExplorerPlugin::instance()->startRunControl(rc, tool->id().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ValgrindPlugin::startValgrindTool(IAnalyzerTool *tool, StartMode mode)
|
void ValgrindPlugin::startValgrindTool(IAnalyzerTool *tool, StartMode mode)
|
||||||
|
Reference in New Issue
Block a user