Disable context menu entries while parsing

Change-Id: Ib562ed00065fedd94fdaed0edb11b0fa62a18de5
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
Christian Stenger
2015-04-10 15:09:45 +02:00
parent 4fb458c9e7
commit f1b240d004
2 changed files with 3 additions and 1 deletions

View File

@@ -55,6 +55,7 @@ public:
explicit TestCodeParser(TestTreeModel *parent = 0); explicit TestCodeParser(TestTreeModel *parent = 0);
virtual ~TestCodeParser(); virtual ~TestCodeParser();
void setState(State state); void setState(State state);
State state() const { return m_parserState; }
#ifdef WITH_TESTS #ifdef WITH_TESTS
int autoTestsCount() const; int autoTestsCount() const;

View File

@@ -86,7 +86,8 @@ TestNavigationWidget::~TestNavigationWidget()
void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event) 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(); const bool hasTests = m_model->hasTests();
QMenu menu; QMenu menu;
QAction *runAll = Core::ActionManager::command(Constants::ACTION_RUN_ALL_ID)->action(); QAction *runAll = Core::ActionManager::command(Constants::ACTION_RUN_ALL_ID)->action();