Prepare scripting feature - add an action in order to open ScriptEditor
AbandonedPublic

Authored by ervin on Apr 21 2015, 4:24 PM.

Details

Reviewers
tdeschastres
fabienboco
bensi
remibenoit
franckarrecot
theovaucher
Maniphest Tasks
Restricted Maniphest Task
Summary
  • Create an action to the toolbar in order to open script editor

Diff Detail

Repository
R4 Zanshin
Lint
Lint Skipped
Unit
Unit Tests Skipped
theovaucher updated this revision to Diff 182.Apr 21 2015, 4:24 PM
theovaucher retitled this revision from to Prepare scripting feature - add an action in order to open ScriptEditor.
theovaucher updated this object.
theovaucher edited the test plan for this revision. (Show Details)
theovaucher set the repository for this revision to R4 Zanshin.
theovaucher added a project: Zanshin.
theovaucher added a task: Restricted Maniphest Task.
ervin requested changes to this revision.Apr 21 2015, 7:12 PM
ervin edited edge metadata.
ervin added inline comments.
src/widgets/applicationcomponents.cpp
171

Please put that on several lines to avoid it being too long. e.g. line breacks after each ,

269

I'd also raise and activate to make sure it comes on top if it was already opened.

src/widgets/applicationcomponents.h
68

Please remove that empty line.

tests/units/widgets/applicationcomponentstest.cpp
520

Please also add a test checking the script editor window is brought up when the action is triggered.

This revision now requires changes to proceed.Apr 21 2015, 7:12 PM
theovaucher marked 3 inline comments as done.Apr 21 2015, 9:50 PM
theovaucher added inline comments.
tests/units/widgets/applicationcomponentstest.cpp
520

Sure, but how?

I tried to trigger the action with action->trigger() but it raise an exception. Maybe set a ScriptEditorStub? And set it in ApplicationComponents?

ervin added inline comments.Apr 22 2015, 4:29 PM
tests/units/widgets/applicationcomponentstest.cpp
520

Assert you mean? You might need to include QtTestGui instead of QtTest. Now the test with running on a QCoreApplication, since a widget will be involved you likely want a QApplication.

theovaucher updated this revision to Diff 238.May 23 2015, 3:57 PM
theovaucher edited edge metadata.

So, when I trigger the action, the test failed. And when I comment this line:

"m_scriptEditor->setScriptHandler(Utils::DependencyManager::globalInstance().create<Scripting::ScriptHandler>());"  (applicationcomponents.cpp#273)

Then the test passed.

I don't know how to fix this. Can you help me please?

ervin added a comment.May 25 2015, 7:28 AM

So, when I trigger the action, the test failed. And when I comment this line:

"m_scriptEditor->setScriptHandler(Utils::DependencyManager::globalInstance().create<Scripting::ScriptHandler>());"  (applicationcomponents.cpp#273)

Then the test passed.

I don't know how to fix this. Can you help me please?

The problem is that you ask the dependency manager a ScriptHandler implementation but none has been provided. You need to configure the dependency manager to provide a stub ScriptHandler in the test, likely you miss something like:
Utils::DependencyManager::globalInstance().add<Scripting::ScriptHandler, StubScriptHandler>()

theovaucher updated this revision to Diff 242.May 25 2015, 1:13 PM
theovaucher edited edge metadata.

Create ScriptHandlerStub

ervin accepted this revision.Jun 29 2015, 7:07 PM
ervin edited edge metadata.

Assuming tests pass.

Sorry for not replying earlier, I got very busy and then we got troubles with the CI, it's all almost solved now so I think this patch can finally go in.

This revision is now accepted and ready to land.Jun 29 2015, 7:07 PM

Hello? Anyone?

theovaucher edited edge metadata.
theovaucher changed the visibility from "All Users" to "Public (No Login Required)".
  • Rebase diff to actual source code.
  • All tests passed.
ervin commandeered this revision.Aug 20 2017, 8:53 PM
ervin edited reviewers, added: theovaucher; removed: ervin.
This revision now requires review to proceed.Aug 20 2017, 8:53 PM
ervin abandoned this revision.Aug 20 2017, 8:53 PM

Closing by lack of activity.