[Ktutorial-commits] SF.net SVN: ktutorial:[367] trunk/ktutorial/ktutorial-editor/src/tutorials
Status: Alpha
Brought to you by:
danxuliu
From: <dan...@us...> - 2012-08-10 18:15:21
|
Revision: 367 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=367&view=rev Author: danxuliu Date: 2012-08-10 18:15:15 +0000 (Fri, 10 Aug 2012) Log Message: ----------- Update names in tutorials to take into account the new ambiguity solving rules. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/tutorials/BasicConcepts.js trunk/ktutorial/ktutorial-editor/src/tutorials/BasicConcepts.xml trunk/ktutorial/ktutorial-editor/src/tutorials/InteractingWithTheTargetApplication.js trunk/ktutorial/ktutorial-editor/src/tutorials/InteractingWithTheTargetApplication.xml Modified: trunk/ktutorial/ktutorial-editor/src/tutorials/BasicConcepts.js =================================================================== --- trunk/ktutorial/ktutorial-editor/src/tutorials/BasicConcepts.js 2012-08-10 18:14:12 UTC (rev 366) +++ trunk/ktutorial/ktutorial-editor/src/tutorials/BasicConcepts.js 2012-08-10 18:15:15 UTC (rev 367) @@ -106,9 +106,9 @@ newWaitForSignalForStartStepReactionStep.setText(t.i18nc("@info", "<para>In the dialog you can select the type of condition to wait for.</para>\n\n<para>There are simple and composed conditions. Simple conditions wait for something specific. Composed conditions wait for other conditions to be met.</para>\n\n<para>In this case, as it will be explained later, we want to wait for a signal, so select \"The specified signal is emitted\" in the <link url=\"widget:waitForTypeComboBox\">combobox</link> and accept the dialog.</para>")); function newWaitForSignalForStartStepReactionStepSetup(step) { - waitForClickedByOkButton = ktutorial.newWaitFor("WaitForSignal"); - waitForClickedByOkButton.setSignal(ktutorial.findObject("okButton"), "clicked()"); - step.addWaitFor(waitForClickedByOkButton, "editWaitForSignalInStartStepReaction"); + waitForClickedByAddWaitForDialogOkButton = ktutorial.newWaitFor("WaitForSignal"); + waitForClickedByAddWaitForDialogOkButton.setSignal(ktutorial.findObject("addWaitForDialog/okButton"), "clicked()"); + step.addWaitFor(waitForClickedByAddWaitForDialogOkButton, "editWaitForSignalInStartStepReaction"); } connect(newWaitForSignalForStartStepReactionStep, "setup(QObject*)", this, "newWaitForSignalForStartStepReactionStepSetup(QObject*)"); @@ -134,9 +134,9 @@ setWaitForSignalTextChangedDataStep.setText(t.i18nc("@info", "<para>The parameters that have to be set depend on the type of the condition. In this case, the name of the object that emits the signal and the name of the signal are needed.</para>\n\n<para><application>KTutorial editor</application> is able to <emphasis>talk</emphasis> to the application that the tutorial is being designed for and show you the name of the objects and the signals they emit. However, this will be seen in another tutorial. In this one you will be given all the values you need.</para>\n\n<para>Ok, back to the condition. We have asked the user to write <emphasis>Hello world!</emphasis> in the text area, so we want to react when the text in the text area changes.</para>\n\n<para>The text area is appropriately named <emphasis>textArea</emphasis>, and it emits the signal <emphasis>textChanged()</emphasis>. Set those values in the <link url=\"widget:objectNameLineEdit\"><interface>emitter name</interface> field</link> and in the <link url=\"widget:signalNameLineEdit\"><interface>signal name</interface> field</link>, respectively, and accept the dialog.</para>")); function setWaitForSignalTextChangedDataStepSetup(step) { - waitForClickedByOkButton = ktutorial.newWaitFor("WaitForSignal"); - waitForClickedByOkButton.setSignal(ktutorial.findObject("okButton"), "clicked()"); - step.addWaitFor(waitForClickedByOkButton, "setResponseInStartStepReaction"); + waitForClickedByEditWaitForSignalDialogOkButton = ktutorial.newWaitFor("WaitForSignal"); + waitForClickedByEditWaitForSignalDialogOkButton.setSignal(ktutorial.findObject("editWaitForSignalDialog/okButton"), "clicked()"); + step.addWaitFor(waitForClickedByEditWaitForSignalDialogOkButton, "setResponseInStartStepReaction"); } connect(setWaitForSignalTextChangedDataStep, "setup(QObject*)", this, "setWaitForSignalTextChangedDataStepSetup(QObject*)"); @@ -232,9 +232,9 @@ editWaitForSignalInClearTextStepStep.setText(t.i18nc("@info", "<para>Usually, buttons in tool bars and menu entries are graphical representations of the so called <emphasis>actions</emphasis>. Actions are commands given to the application, for example, <emphasis>add step</emphasis> or <emphasis>save file</emphasis>, and they behave the same no matter if they were triggered from a tool bar or from the menu.</para>\n\n<para>So, as a rule of thumb, when you expect the user to click on a menu item or in a tool bar button, wait for the <emphasis>triggered()</emphasis> signal of the action they represent, instead of the <emphasis>clicked()</emphasis> signal of the button.</para>\n\n<para>In this case, the object name of the action is just <emphasis>clear</emphasis>. Set it in the emitter name, set the signal name to <emphasis>triggered()</emphasis> and accept the dialog.</para>")); function editWaitForSignalInClearTextStepStepSetup(step) { - waitForClickedByOkButton = ktutorial.newWaitFor("WaitForSignal"); - waitForClickedByOkButton.setSignal(ktutorial.findObject("okButton"), "clicked()"); - step.addWaitFor(waitForClickedByOkButton, "setResponseInClearTextStepReaction"); + waitForClickedByEditWaitForSignalDialogOkButton = ktutorial.newWaitFor("WaitForSignal"); + waitForClickedByEditWaitForSignalDialogOkButton.setSignal(ktutorial.findObject("editWaitForSignalDialog/okButton"), "clicked()"); + step.addWaitFor(waitForClickedByEditWaitForSignalDialogOkButton, "setResponseInClearTextStepReaction"); } connect(editWaitForSignalInClearTextStepStep, "setup(QObject*)", this, "editWaitForSignalInClearTextStepStepSetup(QObject*)"); @@ -246,9 +246,9 @@ setResponseInClearTextStepReactionStep.setText(t.i18nc("@info", "<para>This time there is nothing else to be checked once the condition is met. When the clear action is triggered the text area is cleared, so the signal being emitted is enough to change to the next step in the tutorial.</para>\n\n<para>Just set the name of the step to change to, which we will call <emphasis>end</emphasis>, in the <link url=\"widget:responseStepLineEdit\"><interface>change to step</interface> field</link> and accept the dialog.</para>")); function setResponseInClearTextStepReactionStepSetup(step) { - waitForHideInReactionDialog = ktutorial.newWaitFor("WaitForEvent"); - waitForHideInReactionDialog.setEvent(ktutorial.findObject("ReactionDialog"), "Hide"); - step.addWaitFor(waitForHideInReactionDialog, "addEndStep"); + waitForClickedByOkButton = ktutorial.newWaitFor("WaitForSignal"); + waitForClickedByOkButton.setSignal(ktutorial.findObject("okButton"), "clicked()"); + step.addWaitFor(waitForClickedByOkButton, "addEndStep"); } connect(setResponseInClearTextStepReactionStep, "setup(QObject*)", this, "setResponseInClearTextStepReactionStepSetup(QObject*)"); Modified: trunk/ktutorial/ktutorial-editor/src/tutorials/BasicConcepts.xml =================================================================== --- trunk/ktutorial/ktutorial-editor/src/tutorials/BasicConcepts.xml 2012-08-10 18:14:12 UTC (rev 366) +++ trunk/ktutorial/ktutorial-editor/src/tutorials/BasicConcepts.xml 2012-08-10 18:15:15 UTC (rev 367) @@ -73,7 +73,7 @@ <para>In this case, as it will be explained later, we want to wait for a signal, so select "The specified signal is emitted" in the <link url="widget:waitForTypeComboBox">combobox</link> and accept the dialog.</para></text> <reaction triggerType="ConditionMet" responseType="NextStep"> - <waitForSignal emitterName="okButton" signalName="clicked()"/> + <waitForSignal emitterName="addWaitForDialog/okButton" signalName="clicked()"/> <nextStep id="editWaitForSignalInStartStepReaction"/> </reaction> </step> @@ -97,7 +97,7 @@ <para>The text area is appropriately named <emphasis>textArea</emphasis>, and it emits the signal <emphasis>textChanged()</emphasis>. Set those values in the <link url="widget:objectNameLineEdit"><interface>emitter name</interface> field</link> and in the <link url="widget:signalNameLineEdit"><interface>signal name</interface> field</link>, respectively, and accept the dialog.</para></text> <reaction triggerType="ConditionMet" responseType="NextStep"> - <waitForSignal emitterName="okButton" signalName="clicked()"/> + <waitForSignal emitterName="editWaitForSignalDialog/okButton" signalName="clicked()"/> <nextStep id="setResponseInStartStepReaction"/> </reaction> </step> @@ -169,7 +169,7 @@ <para>In this case, the object name of the action is just <emphasis>clear</emphasis>. Set it in the emitter name, set the signal name to <emphasis>triggered()</emphasis> and accept the dialog.</para></text> <reaction triggerType="ConditionMet" responseType="NextStep"> - <waitForSignal emitterName="okButton" signalName="clicked()"/> + <waitForSignal emitterName="editWaitForSignalDialog/okButton" signalName="clicked()"/> <nextStep id="setResponseInClearTextStepReaction"/> </reaction> </step> @@ -178,7 +178,7 @@ <para>Just set the name of the step to change to, which we will call <emphasis>end</emphasis>, in the <link url="widget:responseStepLineEdit"><interface>change to step</interface> field</link> and accept the dialog.</para></text> <reaction triggerType="ConditionMet" responseType="NextStep"> - <waitForEvent receiverName="ReactionDialog" eventName="Hide"/> + <waitForSignal emitterName="okButton" signalName="clicked()"/> <nextStep id="addEndStep"/> </reaction> </step> Modified: trunk/ktutorial/ktutorial-editor/src/tutorials/InteractingWithTheTargetApplication.js =================================================================== --- trunk/ktutorial/ktutorial-editor/src/tutorials/InteractingWithTheTargetApplication.js 2012-08-10 18:14:12 UTC (rev 366) +++ trunk/ktutorial/ktutorial-editor/src/tutorials/InteractingWithTheTargetApplication.js 2012-08-10 18:15:15 UTC (rev 367) @@ -138,12 +138,12 @@ //Step acceptNewWaitForDialogForStartStepReaction acceptNewWaitForDialogForStartStepReactionStep = ktutorial.newStep("acceptNewWaitForDialogForStartStepReaction"); -acceptNewWaitForDialogForStartStepReactionStep.setText(t.i18nc("@info", "<para><link url=\"widget:okButton\">Accept the dialog</link> to add the condition to wait for.</para>")); +acceptNewWaitForDialogForStartStepReactionStep.setText(t.i18nc("@info", "<para><link url=\"widget:addWaitForDialog/okButton\">Accept the dialog</link> to add the condition to wait for.</para>")); function acceptNewWaitForDialogForStartStepReactionStepSetup(step) { - waitForClickedByOkButton = ktutorial.newWaitFor("WaitForSignal"); - waitForClickedByOkButton.setSignal(ktutorial.findObject("okButton"), "clicked()"); - step.addWaitFor(waitForClickedByOkButton, "editWaitForWindowInStartStepReaction"); + waitForClickedByAddWaitForDialogOkButton = ktutorial.newWaitFor("WaitForSignal"); + waitForClickedByAddWaitForDialogOkButton.setSignal(ktutorial.findObject("addWaitForDialog/okButton"), "clicked()"); + step.addWaitFor(waitForClickedByAddWaitForDialogOkButton, "editWaitForWindowInStartStepReaction"); } connect(acceptNewWaitForDialogForStartStepReactionStep, "setup(QObject*)", this, "acceptNewWaitForDialogForStartStepReactionStepSetup(QObject*)"); @@ -224,12 +224,12 @@ //Step selectStepDataDialogInRemoteObjectChooser selectStepDataDialogInRemoteObjectChooserStep = ktutorial.newStep("selectStepDataDialogInRemoteObjectChooser"); -selectStepDataDialogInRemoteObjectChooserStep.setText(t.i18nc("@info", "<para>You may have noticed that the list does not contain the object we are looking for, that is, the dialog that is shown to add a new step. The reason is that the list does not contain all the objects that may exist in the target application at any time. Instead, it is dynamic. When a new object is added or an existing one removed from the target application the list reflects that.</para>\n\n<para>So, in the target application, show the dialog to add a new step. Once you do this, a new object (and all its children) will be added to the end of the list. The object is called <emphasis>StepDataDialog</emphasis> and, yes, it is the dialog that has just been shown.</para>\n\n<para>Select the <emphasis>StepDataDialog</emphasis> element in the list and <link url=\"widget:okButton\">accept the dialog</link>.</para>")); +selectStepDataDialogInRemoteObjectChooserStep.setText(t.i18nc("@info", "<para>You may have noticed that the list does not contain the object we are looking for, that is, the dialog that is shown to add a new step. The reason is that the list does not contain all the objects that may exist in the target application at any time. Instead, it is dynamic. When a new object is added or an existing one removed from the target application the list reflects that.</para>\n\n<para>So, in the target application, show the dialog to add a new step. Once you do this, a new object (and all its children) will be added to the end of the list. The object is called <emphasis>StepDataDialog</emphasis> and, yes, it is the dialog that has just been shown.</para>\n\n<para>Select the <emphasis>StepDataDialog</emphasis> element in the list and <link url=\"widget:RemoteObjectChooser/okButton\">accept the dialog</link>.</para>")); function selectStepDataDialogInRemoteObjectChooserStepSetup(step) { - waitForClickedByOkButton = ktutorial.newWaitFor("WaitForSignal"); - waitForClickedByOkButton.setSignal(ktutorial.findObject("okButton"), "clicked()"); - step.addWaitFor(waitForClickedByOkButton, "acceptEditWaitForWindowDialogForStartStepReaction"); + waitForClickedByRemoteObjectChooserOkButton = ktutorial.newWaitFor("WaitForSignal"); + waitForClickedByRemoteObjectChooserOkButton.setSignal(ktutorial.findObject("RemoteObjectChooser/okButton"), "clicked()"); + step.addWaitFor(waitForClickedByRemoteObjectChooserOkButton, "acceptEditWaitForWindowDialogForStartStepReaction"); } connect(selectStepDataDialogInRemoteObjectChooserStep, "setup(QObject*)", this, "selectStepDataDialogInRemoteObjectChooserStepSetup(QObject*)"); @@ -238,12 +238,12 @@ //Step acceptEditWaitForWindowDialogForStartStepReaction acceptEditWaitForWindowDialogForStartStepReactionStep = ktutorial.newStep("acceptEditWaitForWindowDialogForStartStepReaction"); -acceptEditWaitForWindowDialogForStartStepReactionStep.setText(t.i18nc("@info", "<para>Now that the name of the window was set <link url=\"widget:okButton\">accept the dialog</link>.</para>")); +acceptEditWaitForWindowDialogForStartStepReactionStep.setText(t.i18nc("@info", "<para>Now that the name of the window was set <link url=\"widget:editWaitForWindowDialog/okButton\">accept the dialog</link>.</para>")); function acceptEditWaitForWindowDialogForStartStepReactionStepSetup(step) { - waitForHideInEditWaitForWindowDialog = ktutorial.newWaitFor("WaitForEvent"); - waitForHideInEditWaitForWindowDialog.setEvent(ktutorial.findObject("editWaitForWindowDialog"), "Hide"); - step.addWaitFor(waitForHideInEditWaitForWindowDialog, "setNextStepResponseInStartStepReaction"); + waitForClickedByEditWaitForWindowDialogOkButton = ktutorial.newWaitFor("WaitForSignal"); + waitForClickedByEditWaitForWindowDialogOkButton.setSignal(ktutorial.findObject("editWaitForWindowDialog/okButton"), "clicked()"); + step.addWaitFor(waitForClickedByEditWaitForWindowDialogOkButton, "setNextStepResponseInStartStepReaction"); } connect(acceptEditWaitForWindowDialogForStartStepReactionStep, "setup(QObject*)", this, "acceptEditWaitForWindowDialogForStartStepReactionStepSetup(QObject*)"); @@ -421,12 +421,12 @@ //Step acceptNewWaitForDialogForAcceptDialogStepReaction acceptNewWaitForDialogForAcceptDialogStepReactionStep = ktutorial.newStep("acceptNewWaitForDialogForAcceptDialogStepReaction"); -acceptNewWaitForDialogForAcceptDialogStepReactionStep.setText(t.i18nc("@info", "<para><link url=\"widget:okButton\">Accept the dialog</link> to add the condition to wait for.</para>")); +acceptNewWaitForDialogForAcceptDialogStepReactionStep.setText(t.i18nc("@info", "<para><link url=\"widget:addWaitForDialog/okButton\">Accept the dialog</link> to add the condition to wait for.</para>")); function acceptNewWaitForDialogForAcceptDialogStepReactionStepSetup(step) { - waitForClickedByOkButton = ktutorial.newWaitFor("WaitForSignal"); - waitForClickedByOkButton.setSignal(ktutorial.findObject("okButton"), "clicked()"); - step.addWaitFor(waitForClickedByOkButton, "editWaitForSignalInAcceptDialogStepReaction"); + waitForClickedByAddWaitForDialogOkButton = ktutorial.newWaitFor("WaitForSignal"); + waitForClickedByAddWaitForDialogOkButton.setSignal(ktutorial.findObject("addWaitForDialog/okButton"), "clicked()"); + step.addWaitFor(waitForClickedByAddWaitForDialogOkButton, "editWaitForSignalInAcceptDialogStepReaction"); } connect(acceptNewWaitForDialogForAcceptDialogStepReactionStep, "setup(QObject*)", this, "acceptNewWaitForDialogForAcceptDialogStepReactionStepSetup(QObject*)"); @@ -526,12 +526,12 @@ //Step acceptEditWaitForSignalDialogForAcceptDialogStepReaction acceptEditWaitForSignalDialogForAcceptDialogStepReactionStep = ktutorial.newStep("acceptEditWaitForSignalDialogForAcceptDialogStepReaction"); -acceptEditWaitForSignalDialogForAcceptDialogStepReactionStep.setText(t.i18nc("@info", "<para>Now that the emitter and signal names were set <link url=\"widget:okButton\">accept the dialog</link>.</para>")); +acceptEditWaitForSignalDialogForAcceptDialogStepReactionStep.setText(t.i18nc("@info", "<para>Now that the emitter and signal names were set <link url=\"widget:editWaitForSignalDialog/okButton\">accept the dialog</link>.</para>")); function acceptEditWaitForSignalDialogForAcceptDialogStepReactionStepSetup(step) { - waitForClickedByOkButton = ktutorial.newWaitFor("WaitForSignal"); - waitForClickedByOkButton.setSignal(ktutorial.findObject("okButton"), "clicked()"); - step.addWaitFor(waitForClickedByOkButton, "setNextStepResponseInAcceptDialogStepReaction"); + waitForClickedByEditWaitForSignalDialogOkButton = ktutorial.newWaitFor("WaitForSignal"); + waitForClickedByEditWaitForSignalDialogOkButton.setSignal(ktutorial.findObject("editWaitForSignalDialog/okButton"), "clicked()"); + step.addWaitFor(waitForClickedByEditWaitForSignalDialogOkButton, "setNextStepResponseInAcceptDialogStepReaction"); } connect(acceptEditWaitForSignalDialogForAcceptDialogStepReactionStep, "setup(QObject*)", this, "acceptEditWaitForSignalDialogForAcceptDialogStepReactionStepSetup(QObject*)"); Modified: trunk/ktutorial/ktutorial-editor/src/tutorials/InteractingWithTheTargetApplication.xml =================================================================== --- trunk/ktutorial/ktutorial-editor/src/tutorials/InteractingWithTheTargetApplication.xml 2012-08-10 18:14:12 UTC (rev 366) +++ trunk/ktutorial/ktutorial-editor/src/tutorials/InteractingWithTheTargetApplication.xml 2012-08-10 18:15:15 UTC (rev 367) @@ -75,9 +75,9 @@ </reaction> </step> <step id="acceptNewWaitForDialogForStartStepReaction"> - <text><para><link url="widget:okButton">Accept the dialog</link> to add the condition to wait for.</para></text> + <text><para><link url="widget:addWaitForDialog/okButton">Accept the dialog</link> to add the condition to wait for.</para></text> <reaction triggerType="ConditionMet" responseType="NextStep"> - <waitForSignal emitterName="okButton" signalName="clicked()"/> + <waitForSignal emitterName="addWaitForDialog/okButton" signalName="clicked()"/> <nextStep id="editWaitForWindowInStartStepReaction"/> </reaction> </step> @@ -147,16 +147,16 @@ <para>So, in the target application, show the dialog to add a new step. Once you do this, a new object (and all its children) will be added to the end of the list. The object is called <emphasis>StepDataDialog</emphasis> and, yes, it is the dialog that has just been shown.</para> -<para>Select the <emphasis>StepDataDialog</emphasis> element in the list and <link url="widget:okButton">accept the dialog</link>.</para></text> +<para>Select the <emphasis>StepDataDialog</emphasis> element in the list and <link url="widget:RemoteObjectChooser/okButton">accept the dialog</link>.</para></text> <reaction triggerType="ConditionMet" responseType="NextStep"> - <waitForSignal emitterName="okButton" signalName="clicked()"/> + <waitForSignal emitterName="RemoteObjectChooser/okButton" signalName="clicked()"/> <nextStep id="acceptEditWaitForWindowDialogForStartStepReaction"/> </reaction> </step> <step id="acceptEditWaitForWindowDialogForStartStepReaction"> - <text><para>Now that the name of the window was set <link url="widget:okButton">accept the dialog</link>.</para></text> + <text><para>Now that the name of the window was set <link url="widget:editWaitForWindowDialog/okButton">accept the dialog</link>.</para></text> <reaction triggerType="ConditionMet" responseType="NextStep"> - <waitForEvent receiverName="editWaitForWindowDialog" eventName="Hide"/> + <waitForSignal emitterName="editWaitForWindowDialog/okButton" signalName="clicked()"/> <nextStep id="setNextStepResponseInStartStepReaction"/> </reaction> </step> @@ -254,9 +254,9 @@ </reaction> </step> <step id="acceptNewWaitForDialogForAcceptDialogStepReaction"> - <text><para><link url="widget:okButton">Accept the dialog</link> to add the condition to wait for.</para></text> + <text><para><link url="widget:addWaitForDialog/okButton">Accept the dialog</link> to add the condition to wait for.</para></text> <reaction triggerType="ConditionMet" responseType="NextStep"> - <waitForSignal emitterName="okButton" signalName="clicked()"/> + <waitForSignal emitterName="addWaitForDialog/okButton" signalName="clicked()"/> <nextStep id="editWaitForSignalInAcceptDialogStepReaction"/> </reaction> </step> @@ -313,9 +313,9 @@ </reaction> </step> <step id="acceptEditWaitForSignalDialogForAcceptDialogStepReaction"> - <text><para>Now that the emitter and signal names were set <link url="widget:okButton">accept the dialog</link>.</para></text> + <text><para>Now that the emitter and signal names were set <link url="widget:editWaitForSignalDialog/okButton">accept the dialog</link>.</para></text> <reaction triggerType="ConditionMet" responseType="NextStep"> - <waitForSignal emitterName="okButton" signalName="clicked()"/> + <waitForSignal emitterName="editWaitForSignalDialog/okButton" signalName="clicked()"/> <nextStep id="setNextStepResponseInAcceptDialogStepReaction"/> </reaction> </step> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |