forked from qt-creator/qt-creator
QmlProfiler: Enable attach action only if profiler is current tool
This commit is contained in:
@@ -677,6 +677,8 @@ void AnalyzerManager::toolSelected(int idx)
|
|||||||
updateRunActions();
|
updateRunActions();
|
||||||
|
|
||||||
selectingTool = false;
|
selectingTool = false;
|
||||||
|
|
||||||
|
emit currentToolChanged(newTool);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalyzerManager::toolSelected(QAction *action)
|
void AnalyzerManager::toolSelected(QAction *action)
|
||||||
|
@@ -121,6 +121,9 @@ private slots:
|
|||||||
void loadToolSettings(Analyzer::IAnalyzerTool *tool);
|
void loadToolSettings(Analyzer::IAnalyzerTool *tool);
|
||||||
void updateRunActions();
|
void updateRunActions();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void currentToolChanged(Analyzer::IAnalyzerTool *tool);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class AnalyzerManagerPrivate;
|
class AnalyzerManagerPrivate;
|
||||||
friend class AnalyzerManagerPrivate;
|
friend class AnalyzerManagerPrivate;
|
||||||
|
@@ -204,6 +204,11 @@ void QmlProfilerTool::initialize(ExtensionSystem::IPlugin */*plugin*/)
|
|||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Core::Command::CA_UpdateText);
|
||||||
manalyzer->addAction(command, Analyzer::Constants::G_ANALYZER_STARTSTOP);
|
manalyzer->addAction(command, Analyzer::Constants::G_ANALYZER_STARTSTOP);
|
||||||
connect(d->m_attachAction, SIGNAL(triggered()), this, SLOT(attach()));
|
connect(d->m_attachAction, SIGNAL(triggered()), this, SLOT(attach()));
|
||||||
|
|
||||||
|
Analyzer::AnalyzerManager *analyzerMgr = Analyzer::AnalyzerManager::instance();
|
||||||
|
connect(analyzerMgr, SIGNAL(currentToolChanged(Analyzer::IAnalyzerTool*)),
|
||||||
|
this, SLOT(updateAttachAction()));
|
||||||
|
|
||||||
updateAttachAction();
|
updateAttachAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -344,4 +349,7 @@ void QmlProfilerTool::updateAttachAction()
|
|||||||
d->m_attachAction->setText(tr("Attach..."));
|
d->m_attachAction->setText(tr("Attach..."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
d->m_attachAction->setEnabled(Analyzer::AnalyzerManager::instance()->currentTool() == this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user