From f1b240d004578d54b6497a910098566022c8edb0 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 10 Apr 2015 15:09:45 +0200 Subject: Disable context menu entries while parsing Change-Id: Ib562ed00065fedd94fdaed0edb11b0fa62a18de5 Reviewed-by: David Schulz --- plugins/autotest/testcodeparser.h | 1 + plugins/autotest/testnavigationwidget.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/autotest/testcodeparser.h b/plugins/autotest/testcodeparser.h index f4894e9674..1b8215fe50 100644 --- a/plugins/autotest/testcodeparser.h +++ b/plugins/autotest/testcodeparser.h @@ -55,6 +55,7 @@ public: explicit TestCodeParser(TestTreeModel *parent = 0); virtual ~TestCodeParser(); void setState(State state); + State state() const { return m_parserState; } #ifdef WITH_TESTS int autoTestsCount() const; diff --git a/plugins/autotest/testnavigationwidget.cpp b/plugins/autotest/testnavigationwidget.cpp index df2f0dcdd0..f9847a5782 100644 --- a/plugins/autotest/testnavigationwidget.cpp +++ b/plugins/autotest/testnavigationwidget.cpp @@ -86,7 +86,8 @@ TestNavigationWidget::~TestNavigationWidget() void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event) { - const bool enabled = !TestRunner::instance()->isTestRunning(); + const bool enabled = !TestRunner::instance()->isTestRunning() + && m_model->parser()->state() == TestCodeParser::Idle; const bool hasTests = m_model->hasTests(); QMenu menu; QAction *runAll = Core::ActionManager::command(Constants::ACTION_RUN_ALL_ID)->action(); -- cgit v1.2.1