Commit c31bc05e authored by hjk's avatar hjk Committed by hjk
Browse files

analyzer: make output pane not pop up automatically in all cases

Change-Id: Ief96ab7093d78915087a273f3eff0b4489c3b370
Reviewed-on: http://codereview.qt.nokia.com/30
Reviewed-by: hjk
parent 705d4509
......@@ -516,6 +516,8 @@ void AnalyzerManager::AnalyzerManagerPrivate::startTool()
// make sure mode is shown
q->showMode();
if (q->currentTool()->needsOutputPane())
q->popupOutputPane();
ProjectExplorer::ProjectExplorerPlugin *pe = ProjectExplorer::ProjectExplorerPlugin::instance();
......@@ -896,6 +898,10 @@ void AnalyzerManager::showMode()
{
if (d->m_mode)
ModeManager::instance()->activateMode(d->m_mode->id());
}
void AnalyzerManager::popupOutputPane()
{
d->m_outputpane->popup();
}
......
......@@ -102,6 +102,7 @@ public:
AnalyzerRunControl *createAnalyzer(const AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *rc = 0);
void showMode();
void popupOutputPane();
public slots:
void startTool();
......
......@@ -110,6 +110,9 @@ public:
/// @return true when this tool can be run remotely, e.g. on a meego or maemo device
virtual bool canRunRemotely() const = 0;
/// @return true when this tool needs the output pane to be show on startup
virtual bool needsOutputPane() const = 0;
};
} // namespace Analyzer
......
......@@ -61,10 +61,6 @@ CallgrindEngine::CallgrindEngine(const AnalyzerStartParameters &sp,
m_progress->setProgressRange(0, 2);
}
CallgrindEngine::~CallgrindEngine()
{
}
QStringList CallgrindEngine::toolArguments() const
{
QStringList arguments;
......
......@@ -44,10 +44,10 @@ namespace Internal {
class CallgrindEngine : public Valgrind::Internal::ValgrindEngine
{
Q_OBJECT
public:
explicit CallgrindEngine(const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration);
virtual ~CallgrindEngine();
void start();
......
......@@ -38,7 +38,8 @@
#include <QtCore/QMap>
#include <QtCore/QString>
using namespace Callgrind::Internal;
namespace Callgrind {
namespace Internal {
QColor CallgrindHelper::colorForString(const QString &text)
{
......@@ -65,10 +66,12 @@ QString CallgrindHelper::toPercent(float costs, const QLocale &locale)
{
if (costs > 99.9f)
return locale.toString(100) + locale.percent();
else if (costs > 9.99f)
if (costs > 9.99f)
return locale.toString(costs, 'f', 1) + locale.percent();
else if (costs > 0.009f)
if (costs > 0.009f)
return locale.toString(costs, 'f', 2) + locale.percent();
else
return QString("<") + locale.toString(0.01f) + locale.percent();
return QString("<") + locale.toString(0.01f) + locale.percent();
}
} // namespace Internal
} // namespace Callgrind
......@@ -62,7 +62,7 @@ namespace CallgrindHelper
QString toPercent(float costs, const QLocale &locale = QLocale());
}
}
}
} // namespace Internal
} // namespace Callgrind
#endif // CALLGRINDHELPER_H
......@@ -43,7 +43,6 @@
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzersettings.h>
#include <analyzerbase/analyzerutils.h>
#include <analyzerbase/ianalyzeroutputpaneadapter.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/icontext.h>
......@@ -98,13 +97,13 @@ static QToolButton *createToolButton(QAction *action)
}
CallgrindTool::CallgrindTool(QObject *parent)
: Analyzer::IAnalyzerTool(parent)
, m_callgrindWidgetHandler(0)
, m_dumpAction(0)
, m_resetAction(0)
, m_pauseAction(0)
, m_showCostsOfFunctionAction(0)
, m_toolbarWidget(0)
: Analyzer::IAnalyzerTool(parent)
, m_callgrindWidgetHandler(0)
, m_dumpAction(0)
, m_resetAction(0)
, m_pauseAction(0)
, m_showCostsOfFunctionAction(0)
, m_toolbarWidget(0)
{
Core::ICore *core = Core::ICore::instance();
......@@ -226,12 +225,12 @@ IAnalyzerEngine *CallgrindTool::createEngine(const AnalyzerStartParameters &sp,
{
CallgrindEngine *engine = new CallgrindEngine(sp, runConfiguration);
connect(engine, SIGNAL(parserDataReady(CallgrindEngine *)), SLOT(takeParserData(CallgrindEngine *)));
connect(engine, SIGNAL(parserDataReady(CallgrindEngine *)),
SLOT(takeParserData(CallgrindEngine *)));
connect(engine, SIGNAL(starting(const Analyzer::IAnalyzerEngine*)),
this, SLOT(engineStarting(const Analyzer::IAnalyzerEngine*)));
SLOT(engineStarting(const Analyzer::IAnalyzerEngine*)));
connect(engine, SIGNAL(finished()),
this, SLOT(engineFinished()));
SLOT(engineFinished()));
connect(this, SIGNAL(dumpRequested()), engine, SLOT(dump()));
connect(this, SIGNAL(resetRequested()), engine, SLOT(reset()));
......@@ -299,11 +298,6 @@ QWidget *CallgrindTool::createControlWidget()
return widget;
}
CallgrindWidgetHandler *CallgrindTool::callgrindWidgetHandler() const
{
return m_callgrindWidgetHandler;
}
void CallgrindTool::clearErrorView()
{
clearTextMarks();
......
......@@ -85,10 +85,10 @@ public:
virtual QWidget *createControlWidget();
// For the output pane adapter.
CallgrindWidgetHandler *callgrindWidgetHandler() const;
void clearErrorView();
virtual bool canRunRemotely() const;
bool needsOutputPane() const { return false; }
signals:
void dumpRequested();
......
......@@ -57,7 +57,7 @@
// QGraphicsView::fitInView(const QRectF &rect,
// Qt::AspectRatioMode aspectRatioMode)
// Bug report here: http://bugreports.qt.nokia.com/browse/QTBUG-11945
#define FIT_IN_VIEW_MARGIN 2;
static const int FIT_IN_VIEW_MARGIN = 2;
using namespace Valgrind::Callgrind;
......@@ -218,7 +218,6 @@ class Visualisation::Private
{
public:
Private(Visualisation *qq);
~Private();
void handleMousePressEvent(QMouseEvent *event, bool doubleClicked);
qreal sceneHeight() const;
......@@ -245,11 +244,6 @@ Visualisation::Private::Private(Visualisation *qq)
qq, SLOT(populateScene()));
}
Visualisation::Private::~Private()
{
}
void Visualisation::Private::handleMousePressEvent(QMouseEvent *event,
bool doubleClicked)
{
......@@ -466,5 +460,5 @@ void Visualisation::resizeEvent(QResizeEvent *event)
QGraphicsView::resizeEvent(event);
}
} // Internal
} // Callgrind
} // namespace Internal
} // namespace Callgrind
......@@ -88,7 +88,7 @@ private:
Private *d;
};
} // Internal
} // Callgrind
} // namespace Internal
} // namespace Callgrind
#endif // VALGRIND_CALLGRIND_CALLGRINDVISUALISATION_H
......@@ -320,9 +320,11 @@ IAnalyzerTool::ToolMode MemcheckTool::mode() const
return DebugMode;
}
class FrameFinder : public ErrorListModel::RelevantFrameFinder {
class FrameFinder : public ErrorListModel::RelevantFrameFinder
{
public:
Frame findRelevant(const Error &error) const {
Frame findRelevant(const Error &error) const
{
const QVector<Stack> stacks = error.stacks();
if (stacks.isEmpty())
return Frame();
......@@ -467,7 +469,7 @@ void MemcheckTool::engineStarting(const IAnalyzerEngine *engine)
QMenu *MemcheckTool::filterMenu() const
{
QTC_ASSERT(m_suppressionSeparator, return 0; )
QTC_ASSERT(m_suppressionSeparator, return 0);
foreach (QWidget *w, m_suppressionSeparator->associatedWidgets())
if (QMenu *menu = qobject_cast<QMenu *>(w))
return menu;
......@@ -491,7 +493,8 @@ void MemcheckTool::parserError(const Valgrind::XmlProtocol::Error &error)
void MemcheckTool::internalParserError(const QString &errorString)
{
QMessageBox::critical(m_errorView, tr("Internal Error"), tr("Error occurred parsing valgrind output: %1").arg(errorString));
QMessageBox::critical(m_errorView, tr("Internal Error"),
tr("Error occurred parsing valgrind output: %1").arg(errorString));
}
void MemcheckTool::clearErrorView()
......
......@@ -64,6 +64,7 @@ class AnalyzerSettings;
namespace Memcheck {
namespace Internal {
class MemCheckOutputPaneAdapter;
class MemcheckErrorView;
class FrameFinder;
......@@ -71,6 +72,7 @@ class FrameFinder;
class MemcheckErrorFilterProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
MemcheckErrorFilterProxyModel(QObject *parent = 0);
......@@ -80,6 +82,7 @@ public slots:
protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
private:
QList<int> m_acceptedKinds;
bool m_filterExternalIssues;
......@@ -88,6 +91,7 @@ private:
class MemcheckTool : public Analyzer::IAnalyzerTool
{
Q_OBJECT
public:
explicit MemcheckTool(QObject *parent = 0);
......@@ -96,18 +100,19 @@ public:
ToolMode mode() const;
void initialize();
virtual void extensionsInitialized() {}
void extensionsInitialized() {}
virtual Analyzer::IAnalyzerOutputPaneAdapter *outputPaneAdapter();
virtual Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration = 0);
Analyzer::IAnalyzerOutputPaneAdapter *outputPaneAdapter();
Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration = 0);
// For the output pane adapter.
MemcheckErrorView *ensurePaneErrorView();
QWidget *createPaneToolBarWidget();
void clearErrorView();
virtual bool canRunRemotely() const;
bool canRunRemotely() const;
bool needsOutputPane() const { return true; }
private slots:
void settingsDestroyed(QObject *settings);
......
......@@ -36,16 +36,17 @@
#include "qmlprofilerplugin.h"
#include "qmlprofilerconstants.h"
#include "qmlprofilerattachdialog.h"
#include "qmlprofilersummaryview.h"
#include "tracewindow.h"
#include "timelineview.h"
#include <qmljsdebugclient/qdeclarativedebugclient_p.h>
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerconstants.h>
#include <analyzerbase/ianalyzeroutputpaneadapter.h>
#include "timelineview.h"
#include "canvas/qdeclarativecanvas_p.h"
#include "canvas/qdeclarativecontext2d_p.h"
#include "canvas/qdeclarativetiledcanvas_p.h"
......@@ -69,10 +70,8 @@
#include <QtGui/QHBoxLayout>
#include <QtGui/QLabel>
#include <QtGui/QToolButton>
#include <QtGui/QTabWidget>
#include "qmlprofilersummaryview.h"
#include <QtGui/QToolButton>
using namespace Analyzer;
using namespace QmlProfiler::Internal;
......@@ -96,7 +95,6 @@ public:
virtual void goToNext() { /*TODO*/ }
virtual void goToPrev() { /*TODO*/ }
private:
QmlProfilerTool *m_tool;
};
......@@ -402,6 +400,7 @@ void QmlProfilerTool::attach()
connectClient();
AnalyzerManager::instance()->showMode();
AnalyzerManager::instance()->popupOutputPane();
} else {
stopRecording();
}
......
......@@ -43,6 +43,7 @@ namespace Internal {
class QmlProfilerTool : public Analyzer::IAnalyzerTool
{
Q_OBJECT
public:
explicit QmlProfilerTool(QObject *parent = 0);
~QmlProfilerTool();
......@@ -62,6 +63,7 @@ public:
QWidget *createTimeLineWidget();
bool canRunRemotely() const;
bool needsOutputPane() const { return false; }
void clearDisplay();
......
......@@ -187,7 +187,7 @@ void ValgrindEngine::receiveProcessError(const QString &error, QProcess::Process
///FIXME: get a better API for this into Qt Creator
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
QList< Core::IOutputPane *> panes = pm->getObjects<Core::IOutputPane>();
QList<Core::IOutputPane *> panes = pm->getObjects<Core::IOutputPane>();
foreach (Core::IOutputPane *pane, panes) {
if (pane->displayName() == tr("Application Output")) {
pane->popup(false);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment