forked from qt-creator/qt-creator
Analyzer: more using, less noise.
Change-Id: I0a05fd489342c345bd6c455e809aa4a26c66af4b Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -96,7 +96,9 @@
|
|||||||
#include <QtGui/QPushButton>
|
#include <QtGui/QPushButton>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
using namespace Core::Constants;
|
||||||
using namespace Analyzer::Internal;
|
using namespace Analyzer::Internal;
|
||||||
|
using namespace Analyzer::Constants;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
namespace Analyzer {
|
namespace Analyzer {
|
||||||
@@ -111,33 +113,28 @@ const char INITIAL_DOCK_AREA[] = "initial_dock_area";
|
|||||||
//
|
//
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
class AnalyzerMode : public Core::IMode
|
class AnalyzerMode : public IMode
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AnalyzerMode(QObject *parent = 0)
|
AnalyzerMode(QObject *parent = 0)
|
||||||
: Core::IMode(parent)
|
: IMode(parent)
|
||||||
{
|
{
|
||||||
setContext(Core::Context(
|
setContext(Context(C_EDITORMANAGER, C_ANALYZEMODE, C_NAVIGATION_PANE));
|
||||||
Core::Constants::C_EDITORMANAGER,
|
|
||||||
Constants::C_ANALYZEMODE,
|
|
||||||
Core::Constants::C_NAVIGATION_PANE));
|
|
||||||
setDisplayName(tr("Analyze"));
|
setDisplayName(tr("Analyze"));
|
||||||
setIcon(QIcon(":/images/analyzer_mode.png"));
|
setIcon(QIcon(":/images/analyzer_mode.png"));
|
||||||
setPriority(Constants::P_MODE_ANALYZE);
|
setPriority(P_MODE_ANALYZE);
|
||||||
setId(QLatin1String(Constants::MODE_ANALYZE));
|
setId(QLatin1String(MODE_ANALYZE));
|
||||||
setType(Core::Constants::MODE_EDIT_TYPE);
|
setType(MODE_EDIT_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
~AnalyzerMode()
|
~AnalyzerMode()
|
||||||
{
|
{
|
||||||
// Make sure the editor manager does not get deleted.
|
// Make sure the editor manager does not get deleted.
|
||||||
if (m_widget) {
|
|
||||||
delete m_widget;
|
delete m_widget;
|
||||||
m_widget = 0;
|
m_widget = 0;
|
||||||
}
|
EditorManager::instance()->setParent(0);
|
||||||
Core::EditorManager::instance()->setParent(0);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -160,7 +157,7 @@ public:
|
|||||||
~AnalyzerManagerPrivate();
|
~AnalyzerManagerPrivate();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* After calling this, a proper instance of Core::IMode is initialized
|
* After calling this, a proper instance of IMode is initialized
|
||||||
* It is delayed since an analyzer mode makes no sense without analyzer tools
|
* It is delayed since an analyzer mode makes no sense without analyzer tools
|
||||||
*
|
*
|
||||||
* \note Call this before adding a tool to the manager
|
* \note Call this before adding a tool to the manager
|
||||||
@@ -191,7 +188,7 @@ public slots:
|
|||||||
void startTool();
|
void startTool();
|
||||||
void selectToolboxAction(int);
|
void selectToolboxAction(int);
|
||||||
void selectMenuAction();
|
void selectMenuAction();
|
||||||
void modeChanged(Core::IMode *mode);
|
void modeChanged(IMode *mode);
|
||||||
void resetLayout();
|
void resetLayout();
|
||||||
void updateRunActions();
|
void updateRunActions();
|
||||||
|
|
||||||
@@ -243,8 +240,8 @@ AnalyzerManagerPrivate::AnalyzerManagerPrivate(AnalyzerManager *qq):
|
|||||||
|
|
||||||
setupActions();
|
setupActions();
|
||||||
|
|
||||||
connect(ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)),
|
connect(ModeManager::instance(), SIGNAL(currentModeChanged(IMode*)),
|
||||||
this, SLOT(modeChanged(Core::IMode*)));
|
this, SLOT(modeChanged(IMode*)));
|
||||||
ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance();
|
ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance();
|
||||||
connect(pe, SIGNAL(updateRunActions()), SLOT(updateRunActions()));
|
connect(pe, SIGNAL(updateRunActions()), SLOT(updateRunActions()));
|
||||||
}
|
}
|
||||||
@@ -261,54 +258,52 @@ AnalyzerManagerPrivate::~AnalyzerManagerPrivate()
|
|||||||
|
|
||||||
void AnalyzerManagerPrivate::setupActions()
|
void AnalyzerManagerPrivate::setupActions()
|
||||||
{
|
{
|
||||||
Core::ActionManager *am = Core::ICore::actionManager();
|
ActionManager *am = ICore::actionManager();
|
||||||
const Core::Context globalcontext(Core::Constants::C_GLOBAL);
|
const Context globalcontext(C_GLOBAL);
|
||||||
Core::Command *command = 0;
|
Command *command = 0;
|
||||||
|
|
||||||
// Menus
|
// Menus
|
||||||
m_menu = am->createMenu(Constants::M_DEBUG_ANALYZER);
|
m_menu = am->createMenu(M_DEBUG_ANALYZER);
|
||||||
m_menu->menu()->setTitle(tr("&Analyze"));
|
m_menu->menu()->setTitle(tr("&Analyze"));
|
||||||
m_menu->menu()->setEnabled(true);
|
m_menu->menu()->setEnabled(true);
|
||||||
|
|
||||||
m_menu->appendGroup(Constants::G_ANALYZER_CONTROL);
|
m_menu->appendGroup(G_ANALYZER_CONTROL);
|
||||||
m_menu->appendGroup(Constants::G_ANALYZER_TOOLS);
|
m_menu->appendGroup(G_ANALYZER_TOOLS);
|
||||||
m_menu->appendGroup(Constants::G_ANALYZER_REMOTE_TOOLS);
|
m_menu->appendGroup(G_ANALYZER_REMOTE_TOOLS);
|
||||||
m_menu->appendGroup(Constants::G_ANALYZER_OPTIONS);
|
m_menu->appendGroup(G_ANALYZER_OPTIONS);
|
||||||
|
|
||||||
Core::ActionContainer *menubar =
|
ActionContainer *menubar = am->actionContainer(MENU_BAR);
|
||||||
am->actionContainer(Core::Constants::MENU_BAR);
|
ActionContainer *mtools = am->actionContainer(M_TOOLS);
|
||||||
Core::ActionContainer *mtools =
|
|
||||||
am->actionContainer(Core::Constants::M_TOOLS);
|
|
||||||
menubar->addMenu(mtools, m_menu);
|
menubar->addMenu(mtools, m_menu);
|
||||||
|
|
||||||
m_startAction = new QAction(tr("Start"), m_menu);
|
m_startAction = new QAction(tr("Start"), m_menu);
|
||||||
m_startAction->setIcon(QIcon(Constants::ANALYZER_CONTROL_START_ICON));
|
m_startAction->setIcon(QIcon(ANALYZER_CONTROL_START_ICON));
|
||||||
command = am->registerAction(m_startAction, "Analyzer.Start", globalcontext);
|
command = am->registerAction(m_startAction, "Analyzer.Start", globalcontext);
|
||||||
connect(m_startAction, SIGNAL(triggered()), this, SLOT(startTool()));
|
connect(m_startAction, SIGNAL(triggered()), this, SLOT(startTool()));
|
||||||
|
|
||||||
m_stopAction = new QAction(tr("Stop"), m_menu);
|
m_stopAction = new QAction(tr("Stop"), m_menu);
|
||||||
m_stopAction->setEnabled(false);
|
m_stopAction->setEnabled(false);
|
||||||
m_stopAction->setIcon(QIcon(Constants::ANALYZER_CONTROL_STOP_ICON));
|
m_stopAction->setIcon(QIcon(ANALYZER_CONTROL_STOP_ICON));
|
||||||
command = am->registerAction(m_stopAction, "Analyzer.Stop", globalcontext);
|
command = am->registerAction(m_stopAction, "Analyzer.Stop", globalcontext);
|
||||||
m_menu->addAction(command, Constants::G_ANALYZER_CONTROL);
|
m_menu->addAction(command, G_ANALYZER_CONTROL);
|
||||||
|
|
||||||
QAction *separatorAction1 = new QAction(m_menu);
|
QAction *separatorAction1 = new QAction(m_menu);
|
||||||
separatorAction1->setSeparator(true);
|
separatorAction1->setSeparator(true);
|
||||||
command = am->registerAction(separatorAction1,
|
command = am->registerAction(separatorAction1,
|
||||||
"Menu.Action.Analyzer.Tools.Separator1", globalcontext);
|
"Menu.Action.Analyzer.Tools.Separator1", globalcontext);
|
||||||
m_menu->addAction(command, Constants::G_ANALYZER_TOOLS);
|
m_menu->addAction(command, G_ANALYZER_TOOLS);
|
||||||
|
|
||||||
QAction *separatorAction2 = new QAction(m_menu);
|
QAction *separatorAction2 = new QAction(m_menu);
|
||||||
separatorAction2->setSeparator(true);
|
separatorAction2->setSeparator(true);
|
||||||
command = am->registerAction(separatorAction2,
|
command = am->registerAction(separatorAction2,
|
||||||
"Menu.Action.Analyzer.Tools.Separator2", globalcontext);
|
"Menu.Action.Analyzer.Tools.Separator2", globalcontext);
|
||||||
m_menu->addAction(command, Constants::G_ANALYZER_REMOTE_TOOLS);
|
m_menu->addAction(command, G_ANALYZER_REMOTE_TOOLS);
|
||||||
|
|
||||||
QAction *separatorAction3 = new QAction(m_menu);
|
QAction *separatorAction3 = new QAction(m_menu);
|
||||||
separatorAction3->setSeparator(true);
|
separatorAction3->setSeparator(true);
|
||||||
command = am->registerAction(separatorAction3,
|
command = am->registerAction(separatorAction3,
|
||||||
"Menu.Action.Analyzer.Tools.Separator3", globalcontext);
|
"Menu.Action.Analyzer.Tools.Separator3", globalcontext);
|
||||||
m_menu->addAction(command, Constants::G_ANALYZER_OPTIONS);
|
m_menu->addAction(command, G_ANALYZER_OPTIONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalyzerManagerPrivate::delayedInit()
|
void AnalyzerManagerPrivate::delayedInit()
|
||||||
@@ -338,26 +333,25 @@ void AnalyzerManagerPrivate::delayedInit()
|
|||||||
AnalyzerPlugin::instance()->addAutoReleasedObject(m_mode);
|
AnalyzerPlugin::instance()->addAutoReleasedObject(m_mode);
|
||||||
|
|
||||||
// Populate Windows->Views menu with standard actions.
|
// Populate Windows->Views menu with standard actions.
|
||||||
Core::Context analyzerContext(Constants::C_ANALYZEMODE);
|
Context analyzerContext(C_ANALYZEMODE);
|
||||||
ActionManager *am = ICore::actionManager();
|
ActionManager *am = ICore::actionManager();
|
||||||
ActionContainer *viewsMenu =
|
ActionContainer *viewsMenu = am->actionContainer(Id(M_WINDOW_VIEWS));
|
||||||
am->actionContainer(Core::Id(Core::Constants::M_WINDOW_VIEWS));
|
|
||||||
Command *cmd = am->registerAction(m_mainWindow->menuSeparator1(),
|
Command *cmd = am->registerAction(m_mainWindow->menuSeparator1(),
|
||||||
Core::Id("Analyzer.Views.Separator1"), analyzerContext);
|
Id("Analyzer.Views.Separator1"), analyzerContext);
|
||||||
cmd->setAttribute(Command::CA_Hide);
|
cmd->setAttribute(Command::CA_Hide);
|
||||||
viewsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
|
viewsMenu->addAction(cmd, G_DEFAULT_THREE);
|
||||||
cmd = am->registerAction(m_mainWindow->toggleLockedAction(),
|
cmd = am->registerAction(m_mainWindow->toggleLockedAction(),
|
||||||
Core::Id("Analyzer.Views.ToggleLocked"), analyzerContext);
|
Id("Analyzer.Views.ToggleLocked"), analyzerContext);
|
||||||
cmd->setAttribute(Command::CA_Hide);
|
cmd->setAttribute(Command::CA_Hide);
|
||||||
viewsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
|
viewsMenu->addAction(cmd, G_DEFAULT_THREE);
|
||||||
cmd = am->registerAction(m_mainWindow->menuSeparator2(),
|
cmd = am->registerAction(m_mainWindow->menuSeparator2(),
|
||||||
Core::Id("Analyzer.Views.Separator2"), analyzerContext);
|
Id("Analyzer.Views.Separator2"), analyzerContext);
|
||||||
cmd->setAttribute(Command::CA_Hide);
|
cmd->setAttribute(Command::CA_Hide);
|
||||||
viewsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
|
viewsMenu->addAction(cmd, G_DEFAULT_THREE);
|
||||||
cmd = am->registerAction(m_mainWindow->resetLayoutAction(),
|
cmd = am->registerAction(m_mainWindow->resetLayoutAction(),
|
||||||
Core::Id("Analyzer.Views.ResetSimple"), analyzerContext);
|
Id("Analyzer.Views.ResetSimple"), analyzerContext);
|
||||||
cmd->setAttribute(Command::CA_Hide);
|
cmd->setAttribute(Command::CA_Hide);
|
||||||
viewsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
|
viewsMenu->addAction(cmd, G_DEFAULT_THREE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static QToolButton *toolButton(QAction *action)
|
static QToolButton *toolButton(QAction *action)
|
||||||
@@ -432,17 +426,16 @@ void AnalyzerManagerPrivate::activateDock(Qt::DockWidgetArea area, QDockWidget *
|
|||||||
dockWidget->setParent(m_mainWindow);
|
dockWidget->setParent(m_mainWindow);
|
||||||
m_mainWindow->addDockWidget(area, dockWidget);
|
m_mainWindow->addDockWidget(area, dockWidget);
|
||||||
|
|
||||||
Context globalContext(Core::Constants::C_GLOBAL);
|
Context globalContext(C_GLOBAL);
|
||||||
|
|
||||||
ActionManager *am = ICore::actionManager();
|
ActionManager *am = ICore::actionManager();
|
||||||
QAction *toggleViewAction = dockWidget->toggleViewAction();
|
QAction *toggleViewAction = dockWidget->toggleViewAction();
|
||||||
toggleViewAction->setText(dockWidget->windowTitle());
|
toggleViewAction->setText(dockWidget->windowTitle());
|
||||||
Command *cmd = am->registerAction(toggleViewAction,
|
Command *cmd = am->registerAction(toggleViewAction,
|
||||||
Core::Id("Analyzer." + dockWidget->objectName()), globalContext);
|
Id("Analyzer." + dockWidget->objectName()), globalContext);
|
||||||
cmd->setAttribute(Command::CA_Hide);
|
cmd->setAttribute(Command::CA_Hide);
|
||||||
|
|
||||||
ActionContainer *viewsMenu =
|
ActionContainer *viewsMenu = am->actionContainer(Id(M_WINDOW_VIEWS));
|
||||||
am->actionContainer(Core::Id(Core::Constants::M_WINDOW_VIEWS));
|
|
||||||
viewsMenu->addAction(cmd);
|
viewsMenu->addAction(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -450,7 +443,7 @@ void AnalyzerManagerPrivate::deactivateDock(QDockWidget *dockWidget)
|
|||||||
{
|
{
|
||||||
ActionManager *am = ICore::actionManager();
|
ActionManager *am = ICore::actionManager();
|
||||||
QAction *toggleViewAction = dockWidget->toggleViewAction();
|
QAction *toggleViewAction = dockWidget->toggleViewAction();
|
||||||
am->unregisterAction(toggleViewAction, Core::Id("Analyzer." + dockWidget->objectName()));
|
am->unregisterAction(toggleViewAction, Id("Analyzer." + dockWidget->objectName()));
|
||||||
m_mainWindow->removeDockWidget(dockWidget);
|
m_mainWindow->removeDockWidget(dockWidget);
|
||||||
dockWidget->hide();
|
dockWidget->hide();
|
||||||
// Prevent saveState storing the data of the wrong children.
|
// Prevent saveState storing the data of the wrong children.
|
||||||
@@ -476,7 +469,7 @@ bool buildTypeAccepted(IAnalyzerTool::ToolMode toolMode,
|
|||||||
bool AnalyzerManagerPrivate::showPromptDialog(const QString &title, const QString &text,
|
bool AnalyzerManagerPrivate::showPromptDialog(const QString &title, const QString &text,
|
||||||
const QString &stopButtonText, const QString &cancelButtonText) const
|
const QString &stopButtonText, const QString &cancelButtonText) const
|
||||||
{
|
{
|
||||||
Utils::CheckableMessageBox messageBox(Core::ICore::mainWindow());
|
Utils::CheckableMessageBox messageBox(ICore::mainWindow());
|
||||||
messageBox.setWindowTitle(title);
|
messageBox.setWindowTitle(title);
|
||||||
messageBox.setText(text);
|
messageBox.setText(text);
|
||||||
messageBox.setStandardButtons(QDialogButtonBox::Yes|QDialogButtonBox::Cancel);
|
messageBox.setStandardButtons(QDialogButtonBox::Yes|QDialogButtonBox::Cancel);
|
||||||
@@ -522,7 +515,7 @@ void AnalyzerManagerPrivate::startLocalTool(IAnalyzerTool *tool)
|
|||||||
const QString currentMode =
|
const QString currentMode =
|
||||||
buildType == BuildConfiguration::Debug ? tr("Debug") : tr("Release");
|
buildType == BuildConfiguration::Debug ? tr("Debug") : tr("Release");
|
||||||
|
|
||||||
QSettings *settings = Core::ICore::settings();
|
QSettings *settings = ICore::settings();
|
||||||
const QString configKey = QLatin1String("Analyzer.AnalyzeCorrectMode");
|
const QString configKey = QLatin1String("Analyzer.AnalyzeCorrectMode");
|
||||||
int ret;
|
int ret;
|
||||||
if (settings->contains(configKey)) {
|
if (settings->contains(configKey)) {
|
||||||
@@ -546,7 +539,7 @@ void AnalyzerManagerPrivate::startLocalTool(IAnalyzerTool *tool)
|
|||||||
const QString checkBoxText = tr("&Do not ask again");
|
const QString checkBoxText = tr("&Do not ask again");
|
||||||
bool checkBoxSetting = false;
|
bool checkBoxSetting = false;
|
||||||
const QDialogButtonBox::StandardButton button =
|
const QDialogButtonBox::StandardButton button =
|
||||||
Utils::CheckableMessageBox::question(Core::ICore::mainWindow(),
|
Utils::CheckableMessageBox::question(ICore::mainWindow(),
|
||||||
title, message, checkBoxText,
|
title, message, checkBoxText,
|
||||||
&checkBoxSetting, QDialogButtonBox::Yes|QDialogButtonBox::Cancel,
|
&checkBoxSetting, QDialogButtonBox::Yes|QDialogButtonBox::Cancel,
|
||||||
QDialogButtonBox::Cancel);
|
QDialogButtonBox::Cancel);
|
||||||
@@ -604,8 +597,8 @@ QAction *AnalyzerManagerPrivate::actionFromToolAndMode(IAnalyzerTool *tool, Star
|
|||||||
|
|
||||||
void AnalyzerManagerPrivate::selectSavedTool()
|
void AnalyzerManagerPrivate::selectSavedTool()
|
||||||
{
|
{
|
||||||
const QSettings *settings = Core::ICore::settings();
|
const QSettings *settings = ICore::settings();
|
||||||
const Core::Id lastActiveAction(settings->value(QLatin1String(LAST_ACTIVE_TOOL)).toString());
|
const Id lastActiveAction(settings->value(QLatin1String(LAST_ACTIVE_TOOL)).toString());
|
||||||
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);
|
||||||
@@ -687,14 +680,13 @@ void AnalyzerManagerPrivate::addTool(IAnalyzerTool *tool, const StartModes &mode
|
|||||||
delayedInit(); // Make sure that there is a valid IMode instance.
|
delayedInit(); // Make sure that there is a valid IMode instance.
|
||||||
|
|
||||||
const bool blocked = m_toolBox->blockSignals(true); // Do not make current.
|
const bool blocked = m_toolBox->blockSignals(true); // Do not make current.
|
||||||
ActionManager *am = Core::ICore::actionManager();
|
ActionManager *am = ICore::actionManager();
|
||||||
foreach (StartMode mode, modes) {
|
foreach (StartMode mode, modes) {
|
||||||
QString actionName = tool->actionName(mode);
|
QString actionName = tool->actionName(mode);
|
||||||
Id menuGroup = tool->menuGroup(mode);
|
Id menuGroup = tool->menuGroup(mode);
|
||||||
Id actionId = 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,
|
Command *command = am->registerAction(action, actionId, Context(C_GLOBAL));
|
||||||
Core::Context(Core::Constants::C_GLOBAL));
|
|
||||||
m_menu->addAction(command, menuGroup);
|
m_menu->addAction(command, menuGroup);
|
||||||
command->action()->setData(int(StartLocal));
|
command->action()->setData(int(StartLocal));
|
||||||
// Assuming this happens before project loading.
|
// Assuming this happens before project loading.
|
||||||
@@ -724,7 +716,7 @@ void AnalyzerManagerPrivate::handleToolFinished()
|
|||||||
void AnalyzerManagerPrivate::loadToolSettings(IAnalyzerTool *tool)
|
void AnalyzerManagerPrivate::loadToolSettings(IAnalyzerTool *tool)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_mainWindow, return);
|
QTC_ASSERT(m_mainWindow, return);
|
||||||
QSettings *settings = Core::ICore::settings();
|
QSettings *settings = ICore::settings();
|
||||||
settings->beginGroup(QLatin1String("AnalyzerViewSettings_") + tool->id().toString());
|
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);
|
||||||
@@ -739,7 +731,7 @@ void AnalyzerManagerPrivate::saveToolSettings(IAnalyzerTool *tool, StartMode mod
|
|||||||
return; // no active tool, do nothing
|
return; // no active tool, do nothing
|
||||||
QTC_ASSERT(m_mainWindow, return);
|
QTC_ASSERT(m_mainWindow, return);
|
||||||
|
|
||||||
QSettings *settings = Core::ICore::settings();
|
QSettings *settings = ICore::settings();
|
||||||
settings->beginGroup(QLatin1String("AnalyzerViewSettings_") + tool->id().toString());
|
settings->beginGroup(QLatin1String("AnalyzerViewSettings_") + tool->id().toString());
|
||||||
m_mainWindow->saveSettings(settings);
|
m_mainWindow->saveSettings(settings);
|
||||||
settings->setValue("ToolSettingsSaved", true);
|
settings->setValue("ToolSettingsSaved", true);
|
||||||
|
|||||||
@@ -35,31 +35,33 @@
|
|||||||
#include "ianalyzertool.h"
|
#include "ianalyzertool.h"
|
||||||
#include "analyzermanager.h"
|
#include "analyzermanager.h"
|
||||||
|
|
||||||
|
using namespace Core;
|
||||||
|
|
||||||
namespace Analyzer {
|
namespace Analyzer {
|
||||||
|
|
||||||
IAnalyzerTool::IAnalyzerTool(QObject *parent)
|
IAnalyzerTool::IAnalyzerTool(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
Core::Id IAnalyzerTool::defaultMenuGroup(StartMode mode)
|
Id IAnalyzerTool::defaultMenuGroup(StartMode mode)
|
||||||
{
|
{
|
||||||
if (mode == StartRemote)
|
if (mode == StartRemote)
|
||||||
return Analyzer::Constants::G_ANALYZER_REMOTE_TOOLS;
|
return Constants::G_ANALYZER_REMOTE_TOOLS;
|
||||||
return Analyzer::Constants::G_ANALYZER_TOOLS;
|
return Constants::G_ANALYZER_TOOLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Id IAnalyzerTool::defaultActionId(const IAnalyzerTool *tool, StartMode mode)
|
Id IAnalyzerTool::defaultActionId(const IAnalyzerTool *tool, StartMode mode)
|
||||||
{
|
{
|
||||||
Core::Id id = tool->id();
|
Id id = tool->id();
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case Analyzer::StartLocal:
|
case StartLocal:
|
||||||
return Core::Id(QLatin1String("Analyzer.") + id.name() + QLatin1String(".Local"));
|
return Id(QLatin1String("Analyzer.") + id.name() + QLatin1String(".Local"));
|
||||||
case Analyzer::StartRemote:
|
case StartRemote:
|
||||||
return Core::Id(QLatin1String("Analyzer.") + id.name() + QLatin1String(".Remote"));
|
return Id(QLatin1String("Analyzer.") + id.name() + QLatin1String(".Remote"));
|
||||||
case Analyzer::StartQml:
|
case StartQml:
|
||||||
return Core::Id(QLatin1String("Analyzer.") + id.name() + QLatin1String(".Qml"));
|
return Id(QLatin1String("Analyzer.") + id.name() + QLatin1String(".Qml"));
|
||||||
}
|
}
|
||||||
return Core::Id();
|
return Id();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IAnalyzerTool::defaultActionName(const IAnalyzerTool *tool, StartMode mode)
|
QString IAnalyzerTool::defaultActionName(const IAnalyzerTool *tool, StartMode mode)
|
||||||
|
|||||||
Reference in New Issue
Block a user