analyzer: show busy cursor as long analysis is running

Change-Id: I93ad6ac5e79f5e8a6f843a90b244bfc0587c070c
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2011-12-13 14:01:52 +01:00
committed by hjk
parent 86629f18c2
commit e08f51c21c
4 changed files with 20 additions and 8 deletions

View File

@@ -33,10 +33,10 @@
#ifndef CALLGRINDCOSTVIEW_H #ifndef CALLGRINDCOSTVIEW_H
#define CALLGRINDCOSTVIEW_H #define CALLGRINDCOSTVIEW_H
#include <QtGui/QTreeView>
#include "callgrindcostdelegate.h" #include "callgrindcostdelegate.h"
#include <QtGui/QTreeView>
namespace Valgrind { namespace Valgrind {
namespace Internal { namespace Internal {
@@ -46,13 +46,13 @@ class CostView : public QTreeView
public: public:
explicit CostView(QWidget *parent = 0); explicit CostView(QWidget *parent = 0);
virtual ~CostView(); ~CostView();
/** /**
* Overload automatically updates the cost delegate * Overload automatically updates the cost delegate
* and sets it for the cost columns of DataModel and CallModel. * and sets it for the cost columns of DataModel and CallModel.
*/ */
virtual void setModel(QAbstractItemModel *model); void setModel(QAbstractItemModel *model);
/** /**
* How to format cost data columns in the view. * How to format cost data columns in the view.

View File

@@ -156,7 +156,7 @@ public slots:
void stackBrowserChanged(); void stackBrowserChanged();
/// If \param busy is true, all widgets get a busy cursor when hovered /// If \param busy is true, all widgets get a busy cursor when hovered
void setBusy(bool busy); void setBusyCursor(bool busy);
void dataFunctionSelected(const QModelIndex &index); void dataFunctionSelected(const QModelIndex &index);
void calleeFunctionSelected(const QModelIndex &index); void calleeFunctionSelected(const QModelIndex &index);
@@ -285,7 +285,7 @@ void CallgrindToolPrivate::doClear(bool clearParseData)
m_proxyModel->setFilterFixedString(QString()); m_proxyModel->setFilterFixedString(QString());
} }
void CallgrindToolPrivate::setBusy(bool busy) void CallgrindToolPrivate::setBusyCursor(bool busy)
{ {
QCursor cursor(busy ? Qt::BusyCursor : Qt::ArrowCursor); QCursor cursor(busy ? Qt::BusyCursor : Qt::ArrowCursor);
m_flatView->setCursor(cursor); m_flatView->setCursor(cursor);
@@ -468,7 +468,7 @@ void CallgrindToolPrivate::setParseData(ParseData *data)
m_stackBrowser->clear(); m_stackBrowser->clear();
// unset busy state // unset busy state
setBusy(false); //setBusy(false);
} }
void CallgrindToolPrivate::updateEventCombo() void CallgrindToolPrivate::updateEventCombo()
@@ -614,6 +614,7 @@ IAnalyzerEngine *CallgrindToolPrivate::createEngine(const AnalyzerStartParameter
void CallgrindTool::startTool(StartMode mode) void CallgrindTool::startTool(StartMode mode)
{ {
ValgrindPlugin::startValgrindTool(this, mode); ValgrindPlugin::startValgrindTool(this, mode);
d->setBusyCursor(true);
} }
QWidget *CallgrindTool::createWidgets() QWidget *CallgrindTool::createWidgets()
@@ -863,6 +864,8 @@ void CallgrindToolPrivate::engineFinished()
showParserResults(data); showParserResults(data);
else else
AnalyzerManager::showStatusMessage(tr("Profiling aborted.")); AnalyzerManager::showStatusMessage(tr("Profiling aborted."));
setBusyCursor(false);
} }
void CallgrindToolPrivate::showParserResults(const ParseData *data) void CallgrindToolPrivate::showParserResults(const ParseData *data)
@@ -944,7 +947,7 @@ void CallgrindToolPrivate::handleShowCostsOfFunction()
void CallgrindToolPrivate::slotRequestDump() void CallgrindToolPrivate::slotRequestDump()
{ {
setBusy(true); //setBusy(true);
m_visualisation->setText(tr("Populating...")); m_visualisation->setText(tr("Populating..."));
dumpRequested(); dumpRequested();
} }

View File

@@ -465,6 +465,7 @@ void MemcheckTool::startTool(StartMode mode)
void MemcheckTool::engineStarting(const IAnalyzerEngine *engine) void MemcheckTool::engineStarting(const IAnalyzerEngine *engine)
{ {
setBusyCursor(true);
clearErrorView(); clearErrorView();
QString dir; QString dir;
@@ -548,6 +549,13 @@ void MemcheckTool::finished()
m_goNext->setEnabled(n > 1); m_goNext->setEnabled(n > 1);
const QString msg = AnalyzerManager::msgToolFinished(displayName(), n); const QString msg = AnalyzerManager::msgToolFinished(displayName(), n);
AnalyzerManager::showStatusMessage(msg); AnalyzerManager::showStatusMessage(msg);
setBusyCursor(false);
}
void MemcheckTool::setBusyCursor(bool busy)
{
QCursor cursor(busy ? Qt::BusyCursor : Qt::ArrowCursor);
m_errorView->setCursor(cursor);
} }
} // namespace Internal } // namespace Internal

View File

@@ -113,6 +113,7 @@ private:
ToolMode toolMode() const; ToolMode toolMode() const;
void extensionsInitialized() {} void extensionsInitialized() {}
QWidget *createWidgets(); QWidget *createWidgets();
void setBusyCursor(bool busy);
Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp, Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration = 0); ProjectExplorer::RunConfiguration *runConfiguration = 0);