[Ktutorial-commits] SF.net SVN: ktutorial:[242] trunk/ktutorial/ktutorial-library/src/tutorials /Us
Status: Alpha
Brought to you by:
danxuliu
From: <dan...@us...> - 2010-05-18 15:42:21
|
Revision: 242 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=242&view=rev Author: danxuliu Date: 2010-05-18 15:42:15 +0000 (Tue, 18 May 2010) Log Message: ----------- Add widget highlighting information to the tutorial about how to use tutorials. Modified Paths: -------------- trunk/ktutorial/ktutorial-library/src/tutorials/UsingKTutorial.cpp Modified: trunk/ktutorial/ktutorial-library/src/tutorials/UsingKTutorial.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/src/tutorials/UsingKTutorial.cpp 2010-05-18 15:39:17 UTC (rev 241) +++ trunk/ktutorial/ktutorial-library/src/tutorials/UsingKTutorial.cpp 2010-05-18 15:42:15 UTC (rev 242) @@ -29,6 +29,7 @@ #include "../TutorialInformation.h" #include "../WaitForEvent.h" #include "../WaitForSignal.h" +#include "../view/StepTextWidget.h" #include "../view/StepWidget.h" class WaitForLeftMouseButtonPressed: public WaitForEvent { @@ -77,12 +78,12 @@ }; -class CloseTextEditStep: public Step { +class HighlightTextEditStep: public Step { Q_OBJECT public: - CloseTextEditStep(): - Step("closeTextEdit") { + HighlightTextEditStep(): + Step("highlightTextEdit") { } virtual void setup() { @@ -222,21 +223,41 @@ addStep(clearTextStep); - //Step closeTextEdit - Step* closeTextEditStep = new CloseTextEditStep(); - closeTextEditStep->setText(i18nc("@info", + //Step textCleared + Step* textClearedStep = new Step("textCleared"); + textClearedStep->setText(i18nc("@info", "<para>Do you see? You are in a new step, but you didn't tell the tutorial to " "continue to the next step, and neither you had to select between several " "options. The tutorial advanced automatically when you erased the text as " "requested. This will be the most common way to advance from one step to " -"another.</para>" +"another.</para>")); + + textClearedStep->addOption(new Option(i18nc("@action", "Continue")), + "highlightTextEdit"); + + addStep(textClearedStep); + + //Step highlightTextEdit + //As changing to another step stops the highlighting in the currently + //highlighted widget, it is not possible to use one step to show how to + //highlight the widget and the next one to show how to stop highlighting it + Step* highlightTextEditStep = new HighlightTextEditStep(); + highlightTextEditStep->setText(i18nc("@info", +"<para>Sometimes, a tutorial may provide a link to a <emphasis>widget" +"</emphasis> (an element of the graphical user interface, like a button). For " +"example, <a href=\"widget:usingKTutorialTextEdit\">this is a link to the text " +"area</a>.</para>" +"<para>When you click on a link to a widget, the widget is highlighted to help " +"you to spot it. If you click again on it, the highlighting will be stopped. " +"In this example it is pretty clear what the text area refers to, but it can " +"be useful in tutorials for more complex applications.</para>" "<para>Ok, close the window with the text area to continue with the " "tutorial.</para>")); //WaitFor is added in step setup, as it uses an object that isn't available //when the tutorial is created - addStep(closeTextEditStep); + addStep(highlightTextEditStep); //Step moveWidgetPress Step* moveWidgetPressStep = new MoveWidgetPressStep(); @@ -289,7 +310,7 @@ findObject<QTextEdit*>("usingKTutorialTextEdit"); if (textEdit->toPlainText().isEmpty()) { - nextStep("closeTextEdit"); + nextStep("highlightTextEdit"); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |