<table><tr><td style="">amankumargupta added inline comments.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D12329">View Revision</a></tr></table><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D12329#inline-62432">View Inline</a><span style="color: #4b4d51; font-weight: bold;">AnswerSheet.qml:76</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"> <span class="bright"></span><span style="color: #aa4000"><span class="bright">Keys.onLeft</span>Pressed<span class="bright">:</span></span><span class="bright"> </span><span style="color: #004012"><span class="bright">moveCurrentIndexLeft</span></span><span class="bright"></span><span class="p"><span class="bright">()</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"> <span class="bright"></span><span style="color: #aa4000"><span class="bright">Keys.onUp</span>Pressed<span class="bright">:</span></span><span class="bright"> </span><span style="color: #004012"><span class="bright">moveCurrentIndexUp</span></span><span class="bright"></span><span class="p"><span class="bright">()</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"> <span style="color: #aa4000">Keys.onDownPressed:</span> <span style="color: #004012">moveCurrentIndexDown</span><span class="p">()</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"> <span style="color: #aa4000">Keys.onEnterPressed:</span> <span style="color: #004012">background</span><span class="p">.</span><span style="color: #004012">runCodeOrResetTux</span><span class="p">()</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"> <span style="color: #aa4000">Keys.onReturnPressed:</span> <span style="color: #004012">background</span><span class="p">.</span><span style="color: #004012">runCodeOrResetTux</span><span class="p">()</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="bright"></span><span style="color: #004012"><span class="bright">signal</span></span><span class="bright"> </span><span style="color: #004012"><span class="bright">tabKey</span>Pressed</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="bright"></span><span style="color: #004012"><span class="bright">signal</span></span><span class="bright"> </span><span style="color: #004012"><span class="bright">deleteKey</span>Pressed</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Previously, each code area had their own separate keyboard controls and statements for them and certain statements were redundant. Also additional functions were used to switch the keyboard focus from one to other.</p>
<p style="padding: 0; margin: 8px;">Now, they are centralised. This can be seen in ProgrammingMaze.qml down below for further clarification.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D12329#inline-62435">View Inline</a><span style="color: #4b4d51; font-weight: bold;">AnswerSheet.qml:192</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">onPositionChanged:</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">var</span> <span style="color: #004012">newPos</span> <span style="color: #aa2211">=</span> <span style="color: #004012">codeArea</span><span class="p">.</span><span style="color: #004012">indexAt</span><span class="p">(</span><span style="color: #004012">mouseX</span><span class="p">,</span> <span style="color: #004012">mouseY</span><span class="p">)</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">This portion of code is moved here from line 243 since, the order pressed --> position changed --> released seems more easy to read code than pressed --> released --> position changed.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D12329#inline-62440">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ProgrammingMaze.qml:58</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "><span style="color: #74777d"> property bool insertIntoMain: true</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"><span style="color: #74777d"> property bool insertIntoProcedure: false</span>
</div><div style="padding: 0 8px; margin: 0 4px; "><span style="color: #74777d"> property alias items: items</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">This is an un-needed variable. We can use !background.insertIntoMain in its place everywhere.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D12329#inline-62437">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ProgrammingMaze.qml:114</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"><span style="color: #74777d"> <span class="bright"> mainFunctionCod</span>eArea<span class="bright">.forceActiveFocus()</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"><span style="color: #74777d"> <span class="bright"> background.insertIntoMain = true</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"><span style="color: #74777d"> <span class="bright"> background.insertIntoProcedur</span>e = <span class="bright">fals</span>e</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> <span class="bright">Keys.enabled: items.isTuxMous</span>eArea<span class="bright">Enabled || items.isRunCodeEnabled</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> <span class="bright">Keys.onPressed: {</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> <span class="bright">activity.keyboardNavigationVisibl</span>e = <span class="bright">tru</span>e</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">A centralised keyboard control for all areas which reduces redundancy and simplifies the code a lot.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D12329#inline-62438">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ProgrammingMaze.qml:136</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"><span style="color: #74777d"> <span class="bright">function changeFocus(currentCodeArea) {</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"><span class="bright"></span><span style="color: #74777d"><span class="bright"> if(currentCodeArea === "main") {</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> <span class="bright">onAreaWithKeyboardInputChanged: activeCodeAreaIndicator.changeActiveCodeAreaIndicator(areaWithKeyboardInput)</span></span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">On centralising the keyboard control, this function is no longer needed and the concerned statements are now simplified and put in their respective areas and become more easy to read, understand and follow up for everyone.</p>
<p style="padding: 0; margin: 8px;">Also some redundant statements get eliminated.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D12329#inline-62443">View Inline</a><span style="color: #4b4d51; font-weight: bold;">programmingMaze.js:374</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> */</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #aa4000">function</span> <span style="color: #004012">createProcedureObjects</span><span class="p">()</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #004012">procedureObject</span> <span style="color: #aa2211">=</span> <span style="color: #004012">instructionComponents</span><span class="p">[</span><span style="color: #004012">CALL_PROCEDURE</span><span class="p">].</span><span style="color: #004012">createObject</span><span class="p">(</span><span style="color: #004012">items</span><span class="p">.</span><span style="color: #004012">background</span><span class="p">)</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">This function contains the code moved here from line 402 - 417 and this function is now called from there,</p>
<p style="padding: 0; margin: 8px;">Note: This is further refactored and simplified a lot in the next diff, making the object creation process same for both: procedure as well as main and have the same behavior for them, which is currently not the case in the present code.</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R2 GCompris</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D12329">https://phabricator.kde.org/D12329</a></div></div><br /><div><strong>To: </strong>amankumargupta, GCompris: Improvements<br /><strong>Cc: </strong>KDE Edu, GCompris: Improvements, himanshuvishwakarma, harrymecwan, ganeshredcobra, nityanandkumar, echarruau, rahulyadav, narvaez, scagarwal, apol, timotheegiet, hkaelberer, jjazeix, bcoudoin<br /></div>