ktutorial-commits Mailing List for KTutorial (Page 3)
Status: Alpha
Brought to you by:
danxuliu
You can subscribe to this list here.
2010 |
Jan
(1) |
Feb
(36) |
Mar
(117) |
Apr
(11) |
May
(8) |
Jun
(1) |
Jul
|
Aug
(2) |
Sep
(21) |
Oct
(16) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(1) |
Feb
|
Mar
(6) |
Apr
(6) |
May
(15) |
Jun
(15) |
Jul
(6) |
Aug
|
Sep
(1) |
Oct
(4) |
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(10) |
Jul
(4) |
Aug
(29) |
Sep
(4) |
Oct
|
Nov
|
Dec
(2) |
From: <dan...@us...> - 2011-10-13 14:29:51
|
Revision: 340 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=340&view=rev Author: danxuliu Date: 2011-10-13 14:29:41 +0000 (Thu, 13 Oct 2011) Log Message: ----------- Explicitly process deleteLater() instead of waiting a fixed time. Modified Paths: -------------- trunk/ktutorial/ktutorial-library/tests/view/StepWidgetTest.cpp Modified: trunk/ktutorial/ktutorial-library/tests/view/StepWidgetTest.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/tests/view/StepWidgetTest.cpp 2011-10-13 12:48:24 UTC (rev 339) +++ trunk/ktutorial/ktutorial-library/tests/view/StepWidgetTest.cpp 2011-10-13 14:29:41 UTC (rev 340) @@ -298,9 +298,10 @@ QTest::mouseClick(closeButton(stepWidget), Qt::LeftButton, Qt::NoModifier, QPoint()); - //Give it time to die - QTest::qWait(500); + //Process deleteLater() + QCoreApplication::sendPostedEvents(stepWidget, QEvent::DeferredDelete); + QCOMPARE(destroyedSpy.count(), 1); } @@ -313,7 +314,8 @@ QSignalSpy destroyedSpy(stepWidget, SIGNAL(destroyed(QObject*))); QTest::keyClick(stepWidget, Qt::Key_Escape); - //Give it time to die + + //Give Close button time to complete the press animation QTest::qWait(500); QCOMPARE(destroyedSpy.count(), 1); @@ -343,9 +345,10 @@ QTest::mouseClick(closeButton(stepWidget), Qt::LeftButton, Qt::NoModifier, QPoint(), 500); - //Give it time to die - QTest::qWait(500); + //Process deleteLater() + QCoreApplication::sendPostedEvents(stepWidget, QEvent::DeferredDelete); + QCOMPARE(destroyedSpy.count(), 1); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-10-13 12:48:34
|
Revision: 339 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=339&view=rev Author: danxuliu Date: 2011-10-13 12:48:24 +0000 (Thu, 13 Oct 2011) Log Message: ----------- Use QTest::qWaitForWindowShown instead of waiting a fixed time. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/tests/unit/view/RemoteObjectNameWidgetTest.cpp trunk/ktutorial/ktutorial-library/tests/view/StepTextWidgetTest.cpp trunk/ktutorial/ktutorial-library/tests/view/StepWidgetTest.cpp trunk/ktutorial/ktutorial-library/tests/view/TutorialManagerDialogTest.cpp Modified: trunk/ktutorial/ktutorial-editor/tests/unit/view/RemoteObjectNameWidgetTest.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/tests/unit/view/RemoteObjectNameWidgetTest.cpp 2011-10-13 09:13:34 UTC (rev 338) +++ trunk/ktutorial/ktutorial-editor/tests/unit/view/RemoteObjectNameWidgetTest.cpp 2011-10-13 12:48:24 UTC (rev 339) @@ -382,8 +382,7 @@ //Focus is not set in hidden widgets until they are shown parent.show(); - //Give the parent widget time to be shown - QTest::qWait(500); + QTest::qWaitForWindowShown(&parent); otherLineEdit->setFocus(); @@ -409,8 +408,7 @@ //Focus is not set in hidden widgets until they are shown parent.show(); - //Give the parent widget time to be shown - QTest::qWait(500); + QTest::qWaitForWindowShown(&parent); otherLineEdit->setFocus(); Modified: trunk/ktutorial/ktutorial-library/tests/view/StepTextWidgetTest.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/tests/view/StepTextWidgetTest.cpp 2011-10-13 09:13:34 UTC (rev 338) +++ trunk/ktutorial/ktutorial-library/tests/view/StepTextWidgetTest.cpp 2011-10-13 12:48:24 UTC (rev 339) @@ -133,9 +133,11 @@ widget.setText("The <a href=\"widget:widgetName\">widget to highlight</a>"); widget.show(); + QTest::qWaitForWindowShown(&widget); + QPoint position = centerOfText(widget, "widget to highlight"); QTest::mouseClick(widget.viewport(), Qt::LeftButton, Qt::NoModifier, - position, 500); + position); QVERIFY(widgetToHighlight->findChild<WidgetHighlighter*>("")); } @@ -150,9 +152,11 @@ widget.setText("The <a href=\"widget:widgetName\">widget to highlight</a>"); widget.show(); + QTest::qWaitForWindowShown(&widget); + QPoint position = centerOfText(widget, "widget to highlight"); QTest::mouseClick(widget.viewport(), Qt::LeftButton, Qt::NoModifier, - position, 500); + position); QTest::mouseClick(widget.viewport(), Qt::LeftButton, Qt::NoModifier, position, 500); @@ -172,8 +176,7 @@ widget.setText("The <a href=\"widget:widgetName\">widget to highlight</a>"); widget.show(); - //Give the widget time to be shown - QTest::qWait(500); + QTest::qWaitForWindowShown(&widget); QPoint position = centerOfText(widget, "widget to highlight"); showContextMenuAndSelectFirstOption(widget, position); @@ -191,8 +194,7 @@ widget.setText("The <a href=\"widget:widgetName\">widget to highlight</a>"); widget.show(); - //Give the widget time to be shown - QTest::qWait(500); + QTest::qWaitForWindowShown(&widget); QPoint position = centerOfText(widget, "widget to highlight"); showContextMenuAndSelectFirstOption(widget, position); @@ -215,8 +217,7 @@ widget.setText("The <a href=\"widget:widgetName\">widget to highlight</a>"); widget.show(); - //Give the widget time to be shown - QTest::qWait(500); + QTest::qWaitForWindowShown(&widget); QPoint position = centerOfText(widget, "widget to highlight"); showContextMenuCheckFirstOptionAndCancel(widget, position, @@ -255,12 +256,14 @@ "<a href=\"widget:widget3\">third widget</a>"); widget.show(); + QTest::qWaitForWindowShown(&widget); + QPoint position1 = centerOfText(widget, "first widget"); QPoint position2 = centerOfText(widget, "second widget"); QPoint position3 = centerOfText(widget, "third widget"); QTest::mouseClick(widget.viewport(), Qt::LeftButton, Qt::NoModifier, - position1, 500); + position1); QTest::mouseClick(widget.viewport(), Qt::LeftButton, Qt::NoModifier, position2, 500); @@ -320,9 +323,11 @@ widget.setText("The <a href=\"widget:widgetName\">widget to highlight</a>"); widget.show(); + QTest::qWaitForWindowShown(&widget); + QPoint position = centerOfText(widget, "widget to highlight"); QTest::mouseClick(widget.viewport(), Qt::LeftButton, Qt::NoModifier, - position, 500); + position); QTest::mouseClick(widget.viewport(), Qt::LeftButton, Qt::NoModifier, position, 500); @@ -341,9 +346,11 @@ widget.setText("The <a href=\"widget:widgetName\">widget to highlight</a>"); widget.show(); + QTest::qWaitForWindowShown(&widget); + QPoint position = centerOfText(widget, "widget to highlight"); QTest::mouseClick(widget.viewport(), Qt::LeftButton, Qt::NoModifier, - position, 500); + position); //To get the focus, the parent window of the widget must be active mainWindow.activateWindow(); @@ -365,9 +372,11 @@ widget.setText("The <a href=\"widget:widgetName\">widget to highlight</a>"); widget.show(); + QTest::qWaitForWindowShown(&widget); + QPoint position = centerOfText(widget, "widget to highlight"); QTest::mouseClick(widget.viewport(), Qt::LeftButton, Qt::NoModifier, - position, 500); + position); widget.setText("Another text"); @@ -384,9 +393,11 @@ widget->setText("The <a href=\"widget:widgetName\">widget to highlight</a>"); widget->show(); + QTest::qWaitForWindowShown(widget); + QPoint position = centerOfText(*widget, "widget to highlight"); QTest::mouseClick(widget->viewport(), Qt::LeftButton, Qt::NoModifier, - position, 500); + position); delete widget; @@ -403,9 +414,11 @@ widget->setText("The <a href=\"widget:widgetName\">widget to highlight</a>"); widget->show(); + QTest::qWaitForWindowShown(widget); + QPoint position = centerOfText(*widget, "widget to highlight"); QTest::mouseClick(widget->viewport(), Qt::LeftButton, Qt::NoModifier, - position, 500); + position); delete widgetToHighlight; Modified: trunk/ktutorial/ktutorial-library/tests/view/StepWidgetTest.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/tests/view/StepWidgetTest.cpp 2011-10-13 09:13:34 UTC (rev 338) +++ trunk/ktutorial/ktutorial-library/tests/view/StepWidgetTest.cpp 2011-10-13 12:48:24 UTC (rev 339) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2010 by Daniel Calviño Sánchez * + * Copyright (C) 2009-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -215,7 +215,8 @@ StepWidget stepWidget("Test tutorial"); stepWidget.show(); - QTest::qWait(500); + QTest::qWaitForWindowShown(&stepWidget); + QPoint previousPosition = stepWidget.pos(); QPoint widgetCenter(stepWidget.size().width()/2, @@ -229,7 +230,7 @@ //isn't enabled stepWidget.setMouseTracking(true); QTest::mousePress(&stepWidget, Qt::LeftButton, - Qt::NoModifier, QPoint(), 500); + Qt::NoModifier, QPoint()); QCursor::setPos(previousPosition + widgetCenter + QPoint(42, 23)); QTest::mouseRelease(&stepWidget, Qt::LeftButton, Qt::NoModifier, QPoint(), 500); @@ -245,7 +246,8 @@ StepWidget stepWidget("Test tutorial"); stepWidget.show(); - QTest::qWait(500); + QTest::qWaitForWindowShown(&stepWidget); + QPoint previousPosition = stepWidget.pos(); QPoint widgetCenter(stepWidget.size().width()/2, @@ -259,7 +261,7 @@ //isn't enabled stepWidget.setMouseTracking(true); QTest::mousePress(&stepWidget, Qt::LeftButton, - Qt::NoModifier, QPoint(), 500); + Qt::NoModifier, QPoint()); QCursor::setPos(previousPosition + widgetCenter + QPoint(42, 23)); QTest::mouseRelease(&stepWidget, Qt::LeftButton, Qt::NoModifier, QPoint(), 500); @@ -278,8 +280,10 @@ StepWidget stepWidget("Test tutorial"); stepWidget.show(); - QTest::keyClick(&stepWidget, Qt::Key_F1, Qt::ShiftModifier, 500); + QTest::qWaitForWindowShown(&stepWidget); + QTest::keyClick(&stepWidget, Qt::Key_F1, Qt::ShiftModifier); + QVERIFY(QWhatsThis::inWhatsThisMode()); QWhatsThis::leaveWhatsThisMode(); } @@ -288,10 +292,12 @@ StepWidget* stepWidget = new StepWidget("Test tutorial"); stepWidget->show(); + QTest::qWaitForWindowShown(stepWidget); + QSignalSpy destroyedSpy(stepWidget, SIGNAL(destroyed(QObject*))); QTest::mouseClick(closeButton(stepWidget), Qt::LeftButton, - Qt::NoModifier, QPoint(), 500); + Qt::NoModifier, QPoint()); //Give it time to die QTest::qWait(500); @@ -302,12 +308,10 @@ StepWidget* stepWidget = new StepWidget("Test tutorial"); stepWidget->show(); + QTest::qWaitForWindowShown(stepWidget); + QSignalSpy destroyedSpy(stepWidget, SIGNAL(destroyed(QObject*))); - //The wait can't be made in the keyClick itself as, oddly, a crash happens - //in that case. It seems that the widget is tried to be used (I don't know - //for what) after being deleted if the wait is made in the keyClick. - QTest::qWait(500); QTest::keyClick(stepWidget, Qt::Key_Escape); //Give it time to die QTest::qWait(500); Modified: trunk/ktutorial/ktutorial-library/tests/view/TutorialManagerDialogTest.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/tests/view/TutorialManagerDialogTest.cpp 2011-10-13 09:13:34 UTC (rev 338) +++ trunk/ktutorial/ktutorial-library/tests/view/TutorialManagerDialogTest.cpp 2011-10-13 12:48:24 UTC (rev 339) @@ -173,10 +173,12 @@ mTutorialManagerDialog->show(); + QTest::qWaitForWindowShown(mTutorialManagerDialog); + tutorialList(mTutorialManagerDialog)->setFocus(); QTest::keyClick(tutorialList(mTutorialManagerDialog), Qt::Key_Space, - Qt::NoModifier, 500); + Qt::NoModifier); QItemSelectionModel* selectionModel = tutorialList(mTutorialManagerDialog)->selectionModel(); @@ -213,10 +215,12 @@ mTutorialManagerDialog->show(); + QTest::qWaitForWindowShown(mTutorialManagerDialog); + tutorialList(mTutorialManagerDialog)->setFocus(); QTest::keyClick(tutorialList(mTutorialManagerDialog), Qt::Key_Space, - Qt::NoModifier, 500); + Qt::NoModifier); QItemSelectionModel* selectionModel = tutorialList(mTutorialManagerDialog)->selectionModel(); @@ -255,13 +259,15 @@ mTutorialManagerDialog->show(); + QTest::qWaitForWindowShown(mTutorialManagerDialog); + QItemSelectionModel* selectionModel = tutorialList(mTutorialManagerDialog)->selectionModel(); selectionModel->select(selectionModel->model()->index(1, 0), QItemSelectionModel::Select); QTest::mouseClick(startButton(mTutorialManagerDialog), Qt::LeftButton, - Qt::NoModifier, QPoint(), 500); + Qt::NoModifier, QPoint()); QVERIFY(mTutorialManagerDialog->isHidden()); QVERIFY(mStartStep2->isActive()); @@ -304,7 +310,7 @@ QItemSelectionModel::Select); QTest::keyClick(tutorialList(mTutorialManagerDialog), Qt::Key_Enter, - Qt::NoModifier, 500); + Qt::NoModifier); QVERIFY(mTutorialManagerDialog->isHidden()); QVERIFY(mStartStep2->isActive()); @@ -327,9 +333,14 @@ TutorialManagerDialog tutorialManagerDialog(mTutorialManager); mTutorialManagerDialog->show(); + QTest::qWaitForWindowShown(mTutorialManagerDialog); + QTest::keyClick(tutorialList(mTutorialManagerDialog), Qt::Key_Escape, - Qt::NoModifier, 500); + Qt::NoModifier); + //Give Close button time to complete the press animation + QTest::qWait(500); + QVERIFY(mTutorialManagerDialog->isHidden()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-10-13 09:13:43
|
Revision: 338 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=338&view=rev Author: danxuliu Date: 2011-10-13 09:13:34 +0000 (Thu, 13 Oct 2011) Log Message: ----------- Fix TutorialManagerDialogTest. It seems that, in Qt 4.7, the tutorial list needs to get the focus before receiving the click events or they will have no effect. Modified Paths: -------------- trunk/ktutorial/ktutorial-library/tests/view/TutorialManagerDialogTest.cpp Modified: trunk/ktutorial/ktutorial-library/tests/view/TutorialManagerDialogTest.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/tests/view/TutorialManagerDialogTest.cpp 2011-09-23 13:02:59 UTC (rev 337) +++ trunk/ktutorial/ktutorial-library/tests/view/TutorialManagerDialogTest.cpp 2011-10-13 09:13:34 UTC (rev 338) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2010 by Daniel Calviño Sánchez * + * Copyright (C) 2009-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -173,6 +173,8 @@ mTutorialManagerDialog->show(); + tutorialList(mTutorialManagerDialog)->setFocus(); + QTest::keyClick(tutorialList(mTutorialManagerDialog), Qt::Key_Space, Qt::NoModifier, 500); @@ -211,6 +213,8 @@ mTutorialManagerDialog->show(); + tutorialList(mTutorialManagerDialog)->setFocus(); + QTest::keyClick(tutorialList(mTutorialManagerDialog), Qt::Key_Space, Qt::NoModifier, 500); @@ -274,6 +278,26 @@ mTutorialManagerDialog->show(); + //When the dialog is shown, the focus is given to the Close button. The + //Start button (User1) is the default one, but as it is disabled, the Close + //button becomes the default dialog button. The Start button will become the + //default button again when the Close button receives a FocusOut event. + //However, the dialog must be the active window for the Close button to + //receive the FocusOut event. If the focus is set to the tutorial list but + //the dialog is not the active window no FocusOut event will be sent (as + //QWidget::setFocus calls QApplicationPrivate::setFocusWidget only when the + //widget is in the active window). Even if the dialog became the active + //window later once the focus was set to the tutorial list, no FocusOut + //event would be sent to the Close button. + //Thus, the dialog must have been truly shown before setting the focus to + //the tutorial list. Note that if the dialog is shown but it is not the + //active window (which can happen, for example, when debugging step by step) + //the FocusOut event will not be sent either, but in normal test running + //showing the dialog will make it the active window. + QTest::qWaitForWindowShown(mTutorialManagerDialog); + + tutorialList(mTutorialManagerDialog)->setFocus(); + QItemSelectionModel* selectionModel = tutorialList(mTutorialManagerDialog)->selectionModel(); selectionModel->select(selectionModel->model()->index(1, 0), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-09-23 13:03:05
|
Revision: 337 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=337&view=rev Author: danxuliu Date: 2011-09-23 13:02:59 +0000 (Fri, 23 Sep 2011) Log Message: ----------- Fix wrong behavior when cancelling the open and save dialogs. Modified Paths: -------------- trunk/ktutorial/ktutorial-test-app/TestApp.cpp Modified: trunk/ktutorial/ktutorial-test-app/TestApp.cpp =================================================================== --- trunk/ktutorial/ktutorial-test-app/TestApp.cpp 2011-07-11 13:12:27 UTC (rev 336) +++ trunk/ktutorial/ktutorial-test-app/TestApp.cpp 2011-09-23 13:02:59 UTC (rev 337) @@ -114,7 +114,13 @@ } void MainWindow::saveFileAs() { - saveFileAs(KFileDialog::getSaveFileName()); + QString fileNameFromDialog = KFileDialog::getSaveFileName(); + + if (fileNameFromDialog.isEmpty()) { + return; + } + + saveFileAs(fileNameFromDialog); } void MainWindow::saveFile() { @@ -128,6 +134,10 @@ void MainWindow::openFile() { QString fileNameFromDialog = KFileDialog::getOpenFileName(); + if (fileNameFromDialog.isEmpty()) { + return; + } + QString tmpFile; if(KIO::NetAccess::download(fileNameFromDialog, tmpFile, this)) { QFile file(tmpFile); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-07-11 13:12:33
|
Revision: 336 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=336&view=rev Author: danxuliu Date: 2011-07-11 13:12:27 +0000 (Mon, 11 Jul 2011) Log Message: ----------- Fix doxygen documentation. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.h trunk/ktutorial/ktutorial-editor/src/view/TargetApplicationView.h trunk/ktutorial/ktutorial-editor/src/view/TreeModel.h trunk/ktutorial/ktutorial-editor/src/view/WaitForWidget.h trunk/ktutorial/ktutorial-library/src/KTutorial.h trunk/ktutorial/ktutorial-library/src/Step.h trunk/ktutorial/ktutorial-library/src/WaitForEvent.h trunk/ktutorial/ktutorial-library/src/scripting/ScriptingModule.h Modified: trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.h =================================================================== --- trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.h 2011-07-11 05:25:48 UTC (rev 335) +++ trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.h 2011-07-11 13:12:27 UTC (rev 336) @@ -113,7 +113,7 @@ * an empty string. If the path is absolute but contains "." and ".." * components they are resolved and the clean path is set. * - * @param applicationFilePath The target application file path. + * @param targetApplicationFilePath The target application file path. */ void setTargetApplicationFilePath(const QString& targetApplicationFilePath); Modified: trunk/ktutorial/ktutorial-editor/src/view/TargetApplicationView.h =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/TargetApplicationView.h 2011-07-11 05:25:48 UTC (rev 335) +++ trunk/ktutorial/ktutorial-editor/src/view/TargetApplicationView.h 2011-07-11 13:12:27 UTC (rev 336) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -35,7 +35,7 @@ /** * Creates a new TargetApplicationView for the given TargetApplication. * - * @param step The step to edit. + * @param targetApplication The target application to wrap. * @param parent The parent QWidget for the dialogs and message boxes. */ explicit TargetApplicationView(TargetApplication* targetApplication, Modified: trunk/ktutorial/ktutorial-editor/src/view/TreeModel.h =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/TreeModel.h 2011-07-11 05:25:48 UTC (rev 335) +++ trunk/ktutorial/ktutorial-editor/src/view/TreeModel.h 2011-07-11 13:12:27 UTC (rev 336) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -80,6 +80,7 @@ * If the index is valid, the flags enable the item and allow it to be * selected. * + * @param index The index. * @return The flags for the given index. */ virtual Qt::ItemFlags flags(const QModelIndex& index) const; Modified: trunk/ktutorial/ktutorial-editor/src/view/WaitForWidget.h =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/WaitForWidget.h 2011-07-11 05:25:48 UTC (rev 335) +++ trunk/ktutorial/ktutorial-editor/src/view/WaitForWidget.h 2011-07-11 13:12:27 UTC (rev 336) @@ -53,6 +53,7 @@ /** * Creates a new WaitForWidget. * + * @param waitFor The initial WaitFor. * @param parent The parent QWidget. */ explicit WaitForWidget(WaitFor* waitFor, QWidget* parent = 0); Modified: trunk/ktutorial/ktutorial-library/src/KTutorial.h =================================================================== --- trunk/ktutorial/ktutorial-library/src/KTutorial.h 2011-07-11 05:25:48 UTC (rev 335) +++ trunk/ktutorial/ktutorial-library/src/KTutorial.h 2011-07-11 13:12:27 UTC (rev 336) @@ -74,7 +74,7 @@ * Any WaitFor class has to be registered before calling * setup(KXmlGuiWindow*). * - * @param scriptedWaitFor The QMetaObject to create instances of. + * @param waitForMetaObject The QMetaObject to create instances of. * @param typeName A specific name to be used for the QMetaObject. * @return True if the type was successfully registered, false otherwise. * @see ScriptingModule::registerWaitForMetaObject(const QMetaObject&) Modified: trunk/ktutorial/ktutorial-library/src/Step.h =================================================================== --- trunk/ktutorial/ktutorial-library/src/Step.h 2011-07-11 05:25:48 UTC (rev 335) +++ trunk/ktutorial/ktutorial-library/src/Step.h 2011-07-11 13:12:27 UTC (rev 336) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2010 by Daniel Calviño Sánchez * + * Copyright (C) 2008-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -241,7 +241,7 @@ * This method can be invoked from a script. * * @param option The Option to add. - * @param nextStep The id of the step to change to. + * @param nextStepId The id of the step to change to. * @see addOption(Option*, QObject*, const QString&) */ Q_INVOKABLE void addOption(Option* option, const QString& nextStepId); @@ -286,7 +286,7 @@ * This method can be invoked from a script. * * @param waitFor The condition to wait for. - * @param nextStep The id of the step to change to. + * @param nextStepId The id of the step to change to. * @see addOption(Option*, QObject*, const QString&) */ Q_INVOKABLE void addWaitFor(WaitFor* waitFor, const QString& nextStepId); Modified: trunk/ktutorial/ktutorial-library/src/WaitForEvent.h =================================================================== --- trunk/ktutorial/ktutorial-library/src/WaitForEvent.h 2011-07-11 05:25:48 UTC (rev 335) +++ trunk/ktutorial/ktutorial-library/src/WaitForEvent.h 2011-07-11 13:12:27 UTC (rev 336) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -66,7 +66,7 @@ * Creates a new WaitForEvent. * * @param object The object to watch. - * @param typeName The name of the event type to wait for. + * @param type The type of the event to wait for. */ WaitForEvent(QObject* object, QEvent::Type type); Modified: trunk/ktutorial/ktutorial-library/src/scripting/ScriptingModule.h =================================================================== --- trunk/ktutorial/ktutorial-library/src/scripting/ScriptingModule.h 2011-07-11 05:25:48 UTC (rev 335) +++ trunk/ktutorial/ktutorial-library/src/scripting/ScriptingModule.h 2011-07-11 13:12:27 UTC (rev 336) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009 by Daniel Calviño Sánchez * + * Copyright (C) 2009-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -87,7 +87,7 @@ * with that name). However, if no name is specified, the full name of the * class is used (including namespaces and :: separators). * - * @param scriptedWaitFor The QMetaObject to create instances of. + * @param waitForMetaObject The QMetaObject to create instances of. * @param typeName A specific name to be used for the QMetaObject. * @return True if the type was successfully registered, false otherwise. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-07-11 05:25:54
|
Revision: 335 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=335&view=rev Author: danxuliu Date: 2011-07-11 05:25:48 +0000 (Mon, 11 Jul 2011) Log Message: ----------- Fix "unused variable" compilation warnings. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/serialization/TutorialWriter.cpp trunk/ktutorial/ktutorial-editor/src/view/WaitForWidget.cpp trunk/ktutorial/ktutorial-library/src/WaitForComposed.cpp trunk/ktutorial/ktutorial-library/src/WaitForStepActivation.cpp trunk/ktutorial/ktutorial-library/src/extendedinformation/WidgetHighlighter.cpp Modified: trunk/ktutorial/ktutorial-editor/src/serialization/TutorialWriter.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/serialization/TutorialWriter.cpp 2011-07-07 10:31:17 UTC (rev 334) +++ trunk/ktutorial/ktutorial-editor/src/serialization/TutorialWriter.cpp 2011-07-11 05:25:48 UTC (rev 335) @@ -236,6 +236,8 @@ } void TutorialWriter::write(const WaitForStepActivation* waitForStepActivation) { + Q_UNUSED(waitForStepActivation); + mXmlWriter->writeEmptyElement("waitForStepActivation"); } Modified: trunk/ktutorial/ktutorial-editor/src/view/WaitForWidget.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/WaitForWidget.cpp 2011-07-07 10:31:17 UTC (rev 334) +++ trunk/ktutorial/ktutorial-editor/src/view/WaitForWidget.cpp 2011-07-11 05:25:48 UTC (rev 335) @@ -172,6 +172,8 @@ void WaitForWidget::handleSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected) { + Q_UNUSED(deselected); + //Only single selections are supported Q_ASSERT(selected.count() <= 1); Q_ASSERT(deselected.count() <= 1); Modified: trunk/ktutorial/ktutorial-library/src/WaitForComposed.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/src/WaitForComposed.cpp 2011-07-07 10:31:17 UTC (rev 334) +++ trunk/ktutorial/ktutorial-library/src/WaitForComposed.cpp 2011-07-11 05:25:48 UTC (rev 335) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008 by Daniel Calviño Sánchez * + * Copyright (C) 2008-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -44,6 +44,8 @@ //public slots: void WaitForComposed::childWaitEnd(WaitFor* waitFor) { + Q_UNUSED(waitFor); + Q_ASSERT(mWaitFors.contains(waitFor)); if (!isActive()) { Modified: trunk/ktutorial/ktutorial-library/src/WaitForStepActivation.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/src/WaitForStepActivation.cpp 2011-07-07 10:31:17 UTC (rev 334) +++ trunk/ktutorial/ktutorial-library/src/WaitForStepActivation.cpp 2011-07-11 05:25:48 UTC (rev 335) @@ -60,6 +60,8 @@ //private slots: void WaitForStepActivation::checkStepActivatedToEndTheWait(Step* step) { + Q_UNUSED(step); + if (!isActive()) { return; } Modified: trunk/ktutorial/ktutorial-library/src/extendedinformation/WidgetHighlighter.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/src/extendedinformation/WidgetHighlighter.cpp 2011-07-07 10:31:17 UTC (rev 334) +++ trunk/ktutorial/ktutorial-library/src/extendedinformation/WidgetHighlighter.cpp 2011-07-11 05:25:48 UTC (rev 335) @@ -87,6 +87,8 @@ //protected: void WidgetHighlighter::paintEvent(QPaintEvent* event) { + Q_UNUSED(event); + //Painting the WidgetHighlighter over its parent widget with a //semi-transparent color is the best I could get. However, it has some //flaws. For example, a QMenu does not highlight its menu button. And some This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-07-07 10:31:23
|
Revision: 334 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=334&view=rev Author: danxuliu Date: 2011-07-07 10:31:17 +0000 (Thu, 07 Jul 2011) Log Message: ----------- Set the object name completion as case insensitive. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameWidget.cpp trunk/ktutorial/ktutorial-editor/tests/unit/view/RemoteObjectNameWidgetTest.cpp Modified: trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameWidget.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameWidget.cpp 2011-07-07 02:31:41 UTC (rev 333) +++ trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameWidget.cpp 2011-07-07 10:31:17 UTC (rev 334) @@ -123,6 +123,7 @@ KCompletion* completion = new RemoteObjectNameCompletion(mRemoteObjectNameRegister); completion->setOrder(KCompletion::Sorted); + completion->setIgnoreCase(true); ui->objectNameLineEdit->setCompletionObject(completion); ui->objectNameLineEdit->setAutoDeleteCompletionObject(true); Modified: trunk/ktutorial/ktutorial-editor/tests/unit/view/RemoteObjectNameWidgetTest.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/tests/unit/view/RemoteObjectNameWidgetTest.cpp 2011-07-07 02:31:41 UTC (rev 333) +++ trunk/ktutorial/ktutorial-editor/tests/unit/view/RemoteObjectNameWidgetTest.cpp 2011-07-07 10:31:17 UTC (rev 334) @@ -59,6 +59,7 @@ void testSetChosenRemoteObject(); void testSetChosenRemoteObjectWithNameNotUnique(); + void testNameCompletion(); void testDuplicatedNameCompletion(); void testTargetApplicationStartedAfterWidget(); @@ -247,6 +248,35 @@ assertRemoteObjectSignal(remoteObjectChosenSpy, 2, remoteObject); } +void RemoteObjectNameWidgetTest::testNameCompletion() { + TargetApplication::self()->setTargetApplicationFilePath(mPath); + TargetApplication::self()->start(); + + //Give the target application time to start + QTest::qWait(1000); + + RemoteObjectNameWidget widget; + + KCompletion* completion = objectNameLineEdit(&widget)->completionObject(); + QCOMPARE(completion->order(), KCompletion::Sorted); + + QStringList completionItems = completion->allMatches("The object name 42"); + QCOMPARE(completionItems.count(), 5); + QCOMPARE(completionItems[0], QString("The object name 42")); + QCOMPARE(completionItems[1], QString("The object name 420")); + QCOMPARE(completionItems[2], QString("The object name 421")); + QCOMPARE(completionItems[3], QString("The object name 422")); + QCOMPARE(completionItems[4], QString("The object name 423")); + + completionItems = completion->allMatches("the Object Name 42"); + QCOMPARE(completionItems.count(), 5); + QCOMPARE(completionItems[0], QString("The object name 42")); + QCOMPARE(completionItems[1], QString("The object name 420")); + QCOMPARE(completionItems[2], QString("The object name 421")); + QCOMPARE(completionItems[3], QString("The object name 422")); + QCOMPARE(completionItems[4], QString("The object name 423")); +} + void RemoteObjectNameWidgetTest::testDuplicatedNameCompletion() { TargetApplication::self()->setTargetApplicationFilePath(mPath); TargetApplication::self()->start(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-07-07 02:31:47
|
Revision: 333 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=333&view=rev Author: danxuliu Date: 2011-07-07 02:31:41 +0000 (Thu, 07 Jul 2011) Log Message: ----------- Fix wrong behaviour of StepTextWidget highlighting of widgets after cancelling the context menu. Modified Paths: -------------- trunk/ktutorial/ktutorial-library/src/view/StepTextWidget.cpp trunk/ktutorial/ktutorial-library/src/view/StepTextWidget.h trunk/ktutorial/ktutorial-library/tests/view/StepTextWidgetTest.cpp Modified: trunk/ktutorial/ktutorial-library/src/view/StepTextWidget.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/src/view/StepTextWidget.cpp 2011-07-06 19:40:06 UTC (rev 332) +++ trunk/ktutorial/ktutorial-library/src/view/StepTextWidget.cpp 2011-07-07 02:31:41 UTC (rev 333) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -34,7 +34,8 @@ StepTextWidget::StepTextWidget(QWidget* parent /*= 0*/): KTextEdit(parent), - mCurrentHighlightedWidget(0) { + mCurrentWidget(0), + mCurrentWidgetIsBeingHighlighted(false) { setReadOnly(true); setFrameShape(QFrame::NoFrame); setFrameShadow(QFrame::Plain); @@ -60,13 +61,13 @@ } StepTextWidget::~StepTextWidget() { - if (mCurrentHighlightedWidget) { + if (mCurrentWidgetIsBeingHighlighted) { stopHighlightingCurrentWidget(); } } bool StepTextWidget::eventFilter(QObject* watched, QEvent* event) { - if (watched != mCurrentHighlightedWidget) { + if (watched != mCurrentWidget) { return false; } @@ -106,16 +107,16 @@ QMenu* menu = new QMenu(this); - if (mCurrentHighlightedWidget && - mCurrentHighlightedWidget != widgetForAnchor(anchor)) { + if (mCurrentWidgetIsBeingHighlighted && + mCurrentWidget != widgetForAnchor(anchor)) { stopHighlightingCurrentWidget(); } - if (!mCurrentHighlightedWidget) { + if (!mCurrentWidgetIsBeingHighlighted) { menu->addAction(i18nc("@item:inmenu", "Highlight"), this, SLOT(highlightCurrentWidget())); - mCurrentHighlightedWidget = widgetForAnchor(anchor); + mCurrentWidget = widgetForAnchor(anchor); } else { menu->addAction(i18nc("@item:inmenu", "Stop highlighting"), this, SLOT(stopHighlightingCurrentWidget())); @@ -143,13 +144,13 @@ return; } - if (mCurrentHighlightedWidget && - mCurrentHighlightedWidget != widgetForAnchor(anchor)) { + if (mCurrentWidgetIsBeingHighlighted && + mCurrentWidget != widgetForAnchor(anchor)) { stopHighlightingCurrentWidget(); } - if (!mCurrentHighlightedWidget) { - mCurrentHighlightedWidget = widgetForAnchor(anchor); + if (!mCurrentWidgetIsBeingHighlighted) { + mCurrentWidget = widgetForAnchor(anchor); highlightCurrentWidget(); } else { @@ -185,32 +186,36 @@ void StepTextWidget::updateText() { updateGeometry(); - if (mCurrentHighlightedWidget) { + if (mCurrentWidgetIsBeingHighlighted) { stopHighlightingCurrentWidget(); } } void StepTextWidget::highlightCurrentWidget() { - if (!mCurrentHighlightedWidget) { + if (!mCurrentWidget) { kWarning() << "The widget to highlight was not found!"; return; } - WidgetHighlighterManager::self()->highlight(mCurrentHighlightedWidget); + WidgetHighlighterManager::self()->highlight(mCurrentWidget); - mCurrentHighlightedWidget->installEventFilter(this); + mCurrentWidget->installEventFilter(this); + + mCurrentWidgetIsBeingHighlighted = true; } void StepTextWidget::stopHighlightingCurrentWidget() { - if (!mCurrentHighlightedWidget) { + if (!mCurrentWidget) { kWarning() << "The widget to stop highlighting was not found!"; return; } - WidgetHighlighterManager::self()->stopHighlighting(mCurrentHighlightedWidget); + WidgetHighlighterManager::self()->stopHighlighting(mCurrentWidget); - mCurrentHighlightedWidget->removeEventFilter(this); - mCurrentHighlightedWidget = 0; + mCurrentWidget->removeEventFilter(this); + mCurrentWidget = 0; + + mCurrentWidgetIsBeingHighlighted = false; } } Modified: trunk/ktutorial/ktutorial-library/src/view/StepTextWidget.h =================================================================== --- trunk/ktutorial/ktutorial-library/src/view/StepTextWidget.h 2011-07-06 19:40:06 UTC (rev 332) +++ trunk/ktutorial/ktutorial-library/src/view/StepTextWidget.h 2011-07-07 02:31:41 UTC (rev 333) @@ -135,12 +135,17 @@ private: /** - * The widget currently being highlighted as a result of activating a link - * in this StepTextWidget. + * The last widget referenced by a link activated or selected in this + * StepTextWidget. */ - QPointer<QWidget> mCurrentHighlightedWidget; + QPointer<QWidget> mCurrentWidget; /** + * Whether the current widget is being highlighted or not. + */ + bool mCurrentWidgetIsBeingHighlighted; + + /** * Returns the size for the given text width. * If the width is < 0, the size is adjusted to the text as a rectangle, * with a width bigger than the height. Modified: trunk/ktutorial/ktutorial-library/tests/view/StepTextWidgetTest.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/tests/view/StepTextWidgetTest.cpp 2011-07-06 19:40:06 UTC (rev 332) +++ trunk/ktutorial/ktutorial-library/tests/view/StepTextWidgetTest.cpp 2011-07-07 02:31:41 UTC (rev 333) @@ -19,6 +19,8 @@ #include <QtTest> #include <qtest_kde.h> +#include <QAction> + #include <KXmlGuiWindow> #include "StepTextWidget.h" @@ -35,14 +37,9 @@ class StepTextWidgetTest: public QObject { Q_OBJECT -public slots: - - void selectFirstContextMenuOption(); - private slots: void init(); - void cleanup(); void testConstructor(); @@ -53,6 +50,7 @@ void testStopHighlightingWidgetClickingOnAnchor(); void testHighlightWidgetUsingContextMenu(); void testStopHighlightingWidgetUsingContextMenu(); + void testCancelContextMenu(); void testHighlightSeveralWidgets(); void testHighlightUnknownWidget(); @@ -69,6 +67,10 @@ void showContextMenuAndSelectFirstOption(const StepTextWidget& widget, const QPoint& position); + void showContextMenuCheckFirstOptionAndCancel(const StepTextWidget& widget, + const QPoint& position, + const QString& text); + }; void StepTextWidgetTest::init() { @@ -76,9 +78,6 @@ KTutorial::sSelf = new KTutorial(); } -void StepTextWidgetTest::cleanup() { -} - void StepTextWidgetTest::testConstructor() { QWidget parent; StepTextWidget* widget = new StepTextWidget(&parent); @@ -206,6 +205,40 @@ QVERIFY(!widgetToHighlight->findChild<WidgetHighlighter*>("")); } +void StepTextWidgetTest::testCancelContextMenu() { + KXmlGuiWindow mainWindow; + KTutorial::self()->setup(&mainWindow); + QWidget* widgetToHighlight = new QWidget(&mainWindow); + widgetToHighlight->setObjectName("widgetName"); + + StepTextWidget widget; + widget.setText("The <a href=\"widget:widgetName\">widget to highlight</a>"); + widget.show(); + + //Give the widget time to be shown + QTest::qWait(500); + + QPoint position = centerOfText(widget, "widget to highlight"); + showContextMenuCheckFirstOptionAndCancel(widget, position, + i18n("Highlight")); + + //Ensure that the option text is the right one after cancelling the menu + showContextMenuCheckFirstOptionAndCancel(widget, position, + i18n("Highlight")); + + //Check again when the widget is highlighted + showContextMenuAndSelectFirstOption(widget, position); + + QVERIFY(widgetToHighlight->findChild<WidgetHighlighter*>("")); + + showContextMenuCheckFirstOptionAndCancel(widget, position, + i18n("Stop highlighting")); + + //Ensure that the option text is the right one after cancelling the menu + showContextMenuCheckFirstOptionAndCancel(widget, position, + i18n("Stop highlighting")); +} + void StepTextWidgetTest::testHighlightSeveralWidgets() { KXmlGuiWindow mainWindow; KTutorial::self()->setup(&mainWindow); @@ -383,12 +416,6 @@ /////////////////////////////////// Helpers //////////////////////////////////// -void StepTextWidgetTest::selectFirstContextMenuOption() { - QVERIFY(QApplication::activePopupWidget()); - QTest::keyClick(QApplication::activePopupWidget(), Qt::Key_Down); - QTest::keyClick(QApplication::activePopupWidget(), Qt::Key_Enter); -} - QPoint StepTextWidgetTest::centerOfText(const StepTextWidget& widget, const QString& text) { QTextCursor cursor = widget.document()->find(text); @@ -400,6 +427,46 @@ return widget.cursorRect(cursor).center(); } +//The context menu contains its own event loop, so it won't return to the test +//code until it is closed. Thus, the commands to execute on the menu must be +//"queued", as calling QTest::keyClick after showing the menu won't work. +class QueuedActionsHelper: public QObject { +Q_OBJECT +public: + + QueuedActionsHelper(QObject* parent = 0): QObject(parent) { + setObjectName("helper"); + } + + void setExpectedMenuItemName(const QString& menuItemName) { + mMenuItemName = menuItemName; + } + +public slots: + + void selectFirstContextMenuOption() { + QVERIFY(QApplication::activePopupWidget()); + QTest::keyClick(QApplication::activePopupWidget(), Qt::Key_Down); + QTest::keyClick(QApplication::activePopupWidget(), Qt::Key_Enter); + } + + void assertFirstContextMenuOptionName() { + QVERIFY(QApplication::activePopupWidget()); + QWidget* menu = QApplication::activePopupWidget(); + QCOMPARE(menu->actions()[0]->text(), mMenuItemName); + } + + void cancelContextMenu() { + QVERIFY(QApplication::activePopupWidget()); + QTest::keyClick(QApplication::activePopupWidget(), Qt::Key_Escape); + } + +private: + + QString mMenuItemName; + +}; + void StepTextWidgetTest::showContextMenuAndSelectFirstOption( const StepTextWidget& widget, const QPoint& position) { //The context menu can't be triggered sending a right mouse button press @@ -410,16 +477,34 @@ QContextMenuEvent event(QContextMenuEvent::Mouse, position, widget.mapToGlobal(position)); - //The context menu contains its own event loop, so it won't return to the - //test code until it is closed. Thus, the commands to execute on the dialog - //must be "queued", as calling QTest::keyClick after the button click won't - //work. - QTimer::singleShot(500, this, SLOT(selectFirstContextMenuOption())); + QueuedActionsHelper* helper = new QueuedActionsHelper(this); + QTimer::singleShot(500, helper, SLOT(selectFirstContextMenuOption())); + QApplication::sendEvent(widget.viewport(), &event); } +void StepTextWidgetTest::showContextMenuCheckFirstOptionAndCancel( + const StepTextWidget& widget, + const QPoint& position, + const QString& text) { + //The context menu can't be triggered sending a right mouse button press + //event, as that is platform dependent (that event is not handled by + //QTextEdit or its parents, but by the QApplication for the platform that + //creates a context menu event when needed). An explicit QContextMenuEvent + //must be sent for it to work. + QContextMenuEvent event(QContextMenuEvent::Mouse, position, + widget.mapToGlobal(position)); + + QueuedActionsHelper* helper = new QueuedActionsHelper(this); + helper->setExpectedMenuItemName(text); + QTimer::singleShot(500, helper, SLOT(assertFirstContextMenuOptionName())); + QTimer::singleShot(600, helper, SLOT(cancelContextMenu())); + + QApplication::sendEvent(widget.viewport(), &event); } +} + QTEST_KDEMAIN(view::StepTextWidgetTest, GUI) #include "StepTextWidgetTest.moc" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-07-06 19:40:12
|
Revision: 332 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=332&view=rev Author: danxuliu Date: 2011-07-06 19:40:06 +0000 (Wed, 06 Jul 2011) Log Message: ----------- Remove annoying and not useful tooltip for the text of the step. Modified Paths: -------------- trunk/ktutorial/ktutorial-library/src/view/StepWidget.ui Modified: trunk/ktutorial/ktutorial-library/src/view/StepWidget.ui =================================================================== --- trunk/ktutorial/ktutorial-library/src/view/StepWidget.ui 2011-07-06 19:35:38 UTC (rev 331) +++ trunk/ktutorial/ktutorial-library/src/view/StepWidget.ui 2011-07-06 19:40:06 UTC (rev 332) @@ -67,9 +67,6 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="toolTip"> - <string comment="@info:tooltip">The instructions for this step</string> - </property> <property name="whatsThis"> <string comment="@info:whatsthis">Here appear the instructions for each step of the tutorial.<nl/>Once you complete one step, a new step with new instructions will be shown.</string> </property> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-07-06 19:35:44
|
Revision: 331 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=331&view=rev Author: danxuliu Date: 2011-07-06 19:35:38 +0000 (Wed, 06 Jul 2011) Log Message: ----------- Fix being unable to call setProperty(QObject*, QString, QVariant) from Ruby scripts. A new method, setPropertyToWaitFor, had to be added to avoid the name clash with setProperty(QObject*, QString). Modified Paths: -------------- trunk/ktutorial/ktutorial-library/src/WaitForProperty.cpp trunk/ktutorial/ktutorial-library/src/WaitForProperty.h Modified: trunk/ktutorial/ktutorial-library/src/WaitForProperty.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/src/WaitForProperty.cpp 2011-06-21 15:24:13 UTC (rev 330) +++ trunk/ktutorial/ktutorial-library/src/WaitForProperty.cpp 2011-07-06 19:35:38 UTC (rev 331) @@ -69,6 +69,12 @@ this, SLOT(checkPropertyValueToEndTheWait())); } +void WaitForProperty::setPropertyToWaitFor(QObject* object, + const QString& propertyName, + const QVariant& value) { + setProperty(object, propertyName, value); +} + bool WaitForProperty::conditionMet() const { if (!mObject) { return false; Modified: trunk/ktutorial/ktutorial-library/src/WaitForProperty.h =================================================================== --- trunk/ktutorial/ktutorial-library/src/WaitForProperty.h 2011-06-21 15:24:13 UTC (rev 330) +++ trunk/ktutorial/ktutorial-library/src/WaitForProperty.h 2011-07-06 19:35:38 UTC (rev 331) @@ -100,10 +100,28 @@ * @param propertyName The name of the property. * @param value The value of the property to wait for. */ - Q_INVOKABLE void setProperty(QObject* sender, const QString& propertyName, + Q_INVOKABLE void setProperty(QObject* object, const QString& propertyName, const QVariant& value); /** + * setProperty(QObject*, const QString&, const QVariant&) version to be used + * in Ruby scripts. + * Ruby backend calls setProperty(const char*, const QVariant&) method + * instead of the aforementioned one. This method just offers a non + * overloaded name and delegates the call in the method from + * WaitForProperty. + * + * @param object The object that contains the property. + * @param propertyName The name of the property. + * @param value The value of the property to wait for. + * @todo Remove when Ruby backend gets proper support for overloaded + * methods. + */ + Q_INVOKABLE void setPropertyToWaitFor(QObject* object, + const QString& propertyName, + const QVariant& value); + + /** * Returns true if the property has the expected value, false otherwise. * Note that it will return true even if the property got the expected value * when this WaitForProperty was inactive. That is, as long as the property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-06-21 15:24:19
|
Revision: 330 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=330&view=rev Author: danxuliu Date: 2011-06-21 15:24:13 +0000 (Tue, 21 Jun 2011) Log Message: ----------- Fix memory leak in test. Modified Paths: -------------- trunk/ktutorial/ktutorial-library/tests/WaitForStepActivationTest.cpp Modified: trunk/ktutorial/ktutorial-library/tests/WaitForStepActivationTest.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/tests/WaitForStepActivationTest.cpp 2011-06-21 15:18:34 UTC (rev 329) +++ trunk/ktutorial/ktutorial-library/tests/WaitForStepActivationTest.cpp 2011-06-21 15:24:13 UTC (rev 330) @@ -132,26 +132,26 @@ Step* startStep = new Step("start"); tutorial.addStep(startStep); - WaitForStepActivation* waitForStepActivation = - new WaitForStepActivation(&tutorial, startStep); - waitForStepActivation->setActive(true); + WaitForStepActivation waitForStepActivation(&tutorial, startStep); + waitForStepActivation.setActive(true); - QVERIFY(!waitForStepActivation->conditionMet()); + QVERIFY(!waitForStepActivation.conditionMet()); //WaitFor* must be registered in order to be used with QSignalSpy int waitForStarType = qRegisterMetaType<WaitFor*>("WaitFor*"); - QSignalSpy waitEndedSpy(waitForStepActivation, SIGNAL(waitEnded(WaitFor*))); + QSignalSpy waitEndedSpy(&waitForStepActivation, + SIGNAL(waitEnded(WaitFor*))); - connect(waitForStepActivation, SIGNAL(waitEnded(WaitFor*)), + connect(&waitForStepActivation, SIGNAL(waitEnded(WaitFor*)), this, SLOT(assertConditionMet(WaitFor*))); tutorial.start(); - QVERIFY(!waitForStepActivation->conditionMet()); + QVERIFY(!waitForStepActivation.conditionMet()); QCOMPARE(waitEndedSpy.count(), 1); QVariant argument = waitEndedSpy.at(0).at(0); QCOMPARE(argument.userType(), waitForStarType); - QCOMPARE(qvariant_cast<WaitFor*>(argument), waitForStepActivation); + QCOMPARE(qvariant_cast<WaitFor*>(argument), &waitForStepActivation); } //Should not happen, as WaitForStepActivation is meant to be used only with the @@ -161,16 +161,16 @@ Step* startStep = new Step("start"); tutorial.addStep(startStep); - WaitForStepActivation* waitForStepActivation = - new WaitForStepActivation(&tutorial, startStep); + WaitForStepActivation waitForStepActivation(&tutorial, startStep); //WaitFor* must be registered in order to be used with QSignalSpy qRegisterMetaType<WaitFor*>("WaitFor*"); - QSignalSpy waitEndedSpy(waitForStepActivation, SIGNAL(waitEnded(WaitFor*))); + QSignalSpy waitEndedSpy(&waitForStepActivation, + SIGNAL(waitEnded(WaitFor*))); tutorial.start(); - QVERIFY(!waitForStepActivation->conditionMet()); + QVERIFY(!waitForStepActivation.conditionMet()); QCOMPARE(waitEndedSpy.count(), 0); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-06-21 15:18:40
|
Revision: 329 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=329&view=rev Author: danxuliu Date: 2011-06-21 15:18:34 +0000 (Tue, 21 Jun 2011) Log Message: ----------- Remove applicationFilePath from the D-Bus exposed interface, as it is no longer needed since commit 320. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/RemoteClassStubs.h trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupportAdaptor.cpp trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupportAdaptor.h trunk/ktutorial/ktutorial-library/tests/editorsupport/EditorSupportAdaptorTest.cpp Modified: trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/RemoteClassStubs.h =================================================================== --- trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/RemoteClassStubs.h 2011-06-17 01:51:56 UTC (rev 328) +++ trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/RemoteClassStubs.h 2011-06-21 15:18:34 UTC (rev 329) @@ -226,10 +226,6 @@ public slots: - QString applicationFilePath() const { - return QApplication::applicationFilePath(); - } - int mainWindowObjectId() const { return 42; } Modified: trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupportAdaptor.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupportAdaptor.cpp 2011-06-17 01:51:56 UTC (rev 328) +++ trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupportAdaptor.cpp 2011-06-21 15:18:34 UTC (rev 329) @@ -33,10 +33,6 @@ //public slots: -QString EditorSupportAdaptor::applicationFilePath() const { - return QCoreApplication::applicationFilePath(); -} - int EditorSupportAdaptor::mainWindowObjectId() const { return mEditorSupport->mainWindowObjectId(); } Modified: trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupportAdaptor.h =================================================================== --- trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupportAdaptor.h 2011-06-17 01:51:56 UTC (rev 328) +++ trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupportAdaptor.h 2011-06-21 15:18:34 UTC (rev 329) @@ -48,13 +48,6 @@ public Q_SLOTS: /** - * Returns the path to the application file. - * - * @return The path to the application file. - */ - QString applicationFilePath() const; - - /** * Returns the object id of the application main window. * * @return The object id of the application main window. Modified: trunk/ktutorial/ktutorial-library/tests/editorsupport/EditorSupportAdaptorTest.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/tests/editorsupport/EditorSupportAdaptorTest.cpp 2011-06-17 01:51:56 UTC (rev 328) +++ trunk/ktutorial/ktutorial-library/tests/editorsupport/EditorSupportAdaptorTest.cpp 2011-06-21 15:18:34 UTC (rev 329) @@ -51,8 +51,6 @@ void testConstructor(); - void testApplicationFilePath(); - void testMainWindowObjectId(); void testHighlight(); @@ -75,14 +73,6 @@ QCOMPARE(adaptor->parent(), &editorSupport); } -void EditorSupportAdaptorTest::testApplicationFilePath() { - EditorSupport editorSupport; - EditorSupportAdaptor* adaptor = new EditorSupportAdaptor(&editorSupport); - - QCOMPARE(adaptor->applicationFilePath(), - QCoreApplication::applicationFilePath()); -} - void EditorSupportAdaptorTest::testMainWindowObjectId() { EditorSupport editorSupport; QWidget window; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-06-17 01:52:05
|
Revision: 328 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=328&view=rev Author: danxuliu Date: 2011-06-17 01:51:56 +0000 (Fri, 17 Jun 2011) Log Message: ----------- Update Spanish translations. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/doc/es/ktutorial-editor-handbook.po trunk/ktutorial/ktutorial-editor/doc/es/new-condition.png trunk/ktutorial/ktutorial-editor/doc/es/set-step-data.png trunk/ktutorial/ktutorial-editor/doc/header.pot trunk/ktutorial/ktutorial-editor/doc/ktutorial-editor-handbook.pot trunk/ktutorial/ktutorial-editor/po/es.po trunk/ktutorial/ktutorial-editor/po/ktutorial-editor.pot Modified: trunk/ktutorial/ktutorial-editor/doc/es/ktutorial-editor-handbook.po =================================================================== --- trunk/ktutorial/ktutorial-editor/doc/es/ktutorial-editor-handbook.po 2011-06-17 01:49:37 UTC (rev 327) +++ trunk/ktutorial/ktutorial-editor/doc/es/ktutorial-editor-handbook.po 2011-06-17 01:51:56 UTC (rev 328) @@ -3,14 +3,14 @@ # Copyright (C) 2010 Daniel Calviño Sánchez # This file is distributed under the same license as the ktutorial-editor handbook. # -# Daniel Calviño Sánchez <dan...@gm...>, 2010. +# Daniel Calviño Sánchez <dan...@gm...>, 2010, 2011. msgid "" msgstr "" "Project-Id-Version: ktutorial-editor handbook\n" "Report-Msgid-Bugs-To: http://sourceforge." "net/tracker/?group_id=301227&atid=1270278\n" -"POT-Creation-Date: 2010-10-29 21:49+0000\n" -"PO-Revision-Date: 2010-10-29 23:50+0200\n" +"POT-Creation-Date: 2011-06-15 15:47+0000\n" +"PO-Revision-Date: 2011-06-15 18:01+0200\n" "Last-Translator: Daniel Calviño Sánchez <dan...@gm...>\n" "Language-Team: Spanish <>\n" "MIME-Version: 1.0\n" @@ -751,9 +751,30 @@ "click de nuevo en el enlace detendrá el remarcado del widget." #. Tag: para -#: using.docbook:116 +#: using.docbook:115 #, no-c-format msgid "" +"To ease all these things, &ktutorial-editor; provides several buttons in the " +"step data dialog that help writing KDE semantic markup tags. These buttons " +"insert the start and end tags for an element as needed, and are enabled or " +"disabled based on the position of the cursor in the text. For example, the " +"button to insert a paragraph tag will be disabled if the cursor is inside a " +"link, but the button to insert a link tag will be enabled if the cursor is " +"inside a paragraph." +msgstr "" +"Para hacer más fácil todo esto, &ktutorial-editor; proporciona varios " +"botones en el diálogo de datos del paso que ayudan a escribir etiquetas de " +"marcado semántico de KDE. Estos botones insertan las etiquetas de apertura y " +"cierre de un elemento según sea necesario, y están habilitados o " +"deshabilitados según la posición del cursor en el texto. Por ejemplo, el " +"botón para insertar una etiqueta de párrafo estará deshabilitado si el " +"cursor está dentro de un enlace, pero el botón para insertar una etiqueta de " +"enlace estará habilitado si el cursor está dentro de un párrafo." + +#. Tag: para +#: using.docbook:117 +#, no-c-format +msgid "" "The step data dialog is also shown when a new step is added. If the dialog " "is accepted, the step is added. If the dialog is cancelled, the step is not " "added." @@ -763,7 +784,7 @@ "el paso no se añade." #. Tag: para -#: using.docbook:117 +#: using.docbook:118 #, no-c-format msgid "" "Also note that, in every tutorial, there must be one step with id " @@ -774,19 +795,19 @@ "empieza el tutorial." #. Tag: screeninfo -#: using.docbook:120 +#: using.docbook:121 #, no-c-format msgid "The dialog to set the id and text of a step" msgstr "El diálogo para establecer el identificador y el texto de un paso" #. Tag: phrase -#: using.docbook:126 +#: using.docbook:127 #, no-c-format msgid "Step data edition dialog" msgstr "Diálogo de edición de los datos de un paso" #. Tag: para -#: using.docbook:131 +#: using.docbook:132 #, no-c-format msgid "" "The setup and tear down code dialogs behave like the tutorial ones. The only " @@ -799,7 +820,7 @@ "otro." #. Tag: para -#: using.docbook:132 +#: using.docbook:133 #, no-c-format msgid "" "Also note that the exported scripted tutorial creates all the reactions in " @@ -810,13 +831,13 @@ "inicialización se añade tras ese código." #. Tag: title -#: using.docbook:136 +#: using.docbook:137 #, no-c-format msgid "Reaction edition" msgstr "Edición de reacciones" #. Tag: para -#: using.docbook:138 +#: using.docbook:139 #, no-c-format msgid "" "The reaction dialog is used to set the trigger and response of a reaction. " @@ -828,7 +849,7 @@ "obligatorias, ya que definen el funcionamiento de la reacción." #. Tag: para -#: using.docbook:139 +#: using.docbook:140 #, no-c-format msgid "" "The trigger can be either an option selected or a condition met, but not " @@ -844,7 +865,7 @@ "cuando se cumpla la condición." #. Tag: para -#: using.docbook:140 +#: using.docbook:141 #, no-c-format msgid "" "Likely, the response can be changing to another step or executing some " @@ -860,25 +881,25 @@ "sólo tienes que establecer el cuerpo." #. Tag: screeninfo -#: using.docbook:143 +#: using.docbook:144 #, no-c-format msgid "The dialog to set the trigger and response of a reaction" msgstr "El diálogo para establecer el activador y la respuesta de una reacción" #. Tag: phrase -#: using.docbook:149 +#: using.docbook:150 #, no-c-format msgid "Set reaction data edition dialog" msgstr "Diálogo de edición para establecer los datos de una reacción" #. Tag: title -#: using.docbook:155 +#: using.docbook:156 #, no-c-format msgid "Condition edition" msgstr "Edición de condiciones" #. Tag: para -#: using.docbook:157 +#: using.docbook:158 #, no-c-format msgid "" "The condition that acts as a trigger of a reaction can be a simple condition " @@ -895,7 +916,7 @@ "primero." #. Tag: para -#: using.docbook:158 +#: using.docbook:159 #, no-c-format msgid "" "Due to this, conditions are represented in a tree, and it also affects how " @@ -905,7 +926,7 @@ "manera en que son editadas." #. Tag: para -#: using.docbook:159 +#: using.docbook:160 #, no-c-format msgid "" "A condition can be added as the root condition when there are no other " @@ -922,33 +943,37 @@ "condición y establecer una nueva." #. Tag: screeninfo -#: using.docbook:162 +#: using.docbook:163 #, no-c-format msgid "The dialog to select the type of the new condition to add" msgstr "El diálogo para seleccionar el tipo de la nueva condición a añadir." #. Tag: phrase -#: using.docbook:168 +#: using.docbook:169 #, no-c-format msgid "New condition dialog" msgstr "Diálogo de nueva condición" #. Tag: para -#: using.docbook:173 +#: using.docbook:174 #, no-c-format msgid "" -"Only simple conditions (waiting for an event, waiting for a signal and " -"waiting for a window to be shown) can be edited, showing specific dialogs " -"for it. Composed conditions only group other conditions, so they don't have " -"properties to be edited." +"Only simple conditions (waiting for an event, waiting for a signal, waiting " +"for a window to be shown and waiting for a property to have certain value) " +"can be edited, showing specific dialogs for it. Composed conditions only " +"group other conditions, so they don't have properties to be edited. The " +"condition to wait for its step to be activated, despite being a simple " +"condition, can not be edited either." msgstr "" -"Sólo las condiciones simples (esperar por un evento, esperar por una señal y " -"esperar a que se muestre una ventana) pueden editarse, lo que muestra " -"diálogos específicos para ello. Las condiciones compuestas sólo agrupan " -"otras condiciones, por lo que no tienen propiedades que editar." +"Sólo las condiciones simples (esperar por un evento, esperar por una señal, " +"esperar a que se muestre una ventana y esperar a que una propiedad tenga " +"cierto valor) pueden editarse, lo que muestra diálogos específicos para " +"ello. Las condiciones compuestas sólo agrupan otras condiciones, por lo que " +"no tienen propiedades que editar. La condición para esperar a que se active " +"su paso, a pesar de ser una condición simple, tampoco puede ser editada." #. Tag: para -#: using.docbook:174 +#: using.docbook:175 #, no-c-format msgid "" "Any condition can be removed from its parent composed condition, or from the " @@ -958,7 +983,7 @@ "contiene, o de la reacción si es la condición raíz." #. Tag: para -#: using.docbook:176 +#: using.docbook:177 #, no-c-format msgid "" "There is a special type of condition that verifies that its negated " @@ -981,13 +1006,13 @@ "éste debe añadirse una reacción que pueda cumplirse si la otra no." #. Tag: title -#: using.docbook:179 +#: using.docbook:180 #, no-c-format msgid "Conditions and modal dialogs" msgstr "Condiciones y diálogos modales" #. Tag: para -#: using.docbook:180 +#: using.docbook:181 #, no-c-format msgid "" "Modal dialogs are those that block the interaction with the windows of the " @@ -1006,7 +1031,7 @@ "documento." #. Tag: para -#: using.docbook:181 +#: using.docbook:182 #, no-c-format msgid "" "Take, for example, an <emphasis>Open file</emphasis> dialog. If the " @@ -1026,7 +1051,7 @@ "<emphasis>Abrir archivo</emphasis>." #. Tag: para -#: using.docbook:182 +#: using.docbook:183 #, no-c-format msgid "" "The condition to wait for windows to be shown supports both windows and " @@ -1040,13 +1065,13 @@ "diálogo modal o un diálogo no modal." #. Tag: title -#: using.docbook:189 +#: using.docbook:190 #, no-c-format msgid "Interacting with the target application" msgstr "Interactuando con la aplicación objetivo" #. Tag: para -#: using.docbook:191 +#: using.docbook:192 #, no-c-format msgid "" "When a tutorial is being designed it is usually necessary to know some " @@ -1062,7 +1087,7 @@ "desarrolladores de la aplicación sepan esas cosas de memoria." #. Tag: para -#: using.docbook:192 +#: using.docbook:193 #, no-c-format msgid "" "To help with this problem &ktutorial-editor; is able to \"talk\" with any " @@ -1078,7 +1103,7 @@ "los objetos a los que puede acceder KTutorial en la aplicación objetivo." #. Tag: para -#: using.docbook:193 +#: using.docbook:194 #, no-c-format msgid "" "Note, however, that the intercommunication system between &ktutorial-editor; " @@ -1095,13 +1120,13 @@ "posiblemente ya sabes qué significa todo esto ;)" #. Tag: title -#: using.docbook:196 +#: using.docbook:197 #, no-c-format msgid "Starting the target application" msgstr "Arrancando la aplicación objetivo" #. Tag: para -#: using.docbook:198 +#: using.docbook:199 #, no-c-format msgid "" "&ktutorial-editor; requires an instance of the target application to be " @@ -1113,7 +1138,7 @@ "haber sido lanzada por el propio &ktutorial-editor;." #. Tag: para -#: using.docbook:199 +#: using.docbook:200 #, no-c-format msgid "" "So, how can the target application be started from &ktutorial-editor;? When " @@ -1130,7 +1155,7 @@ "la aplicación de manera manual." #. Tag: para -#: using.docbook:200 +#: using.docbook:201 #, no-c-format msgid "" "Note that the application list contains all the known KDE applications in " @@ -1144,7 +1169,7 @@ "no es válida." #. Tag: para -#: using.docbook:201 +#: using.docbook:202 #, no-c-format msgid "" "Once a valid target application has been specified it will be used " @@ -1159,13 +1184,13 @@ "aplicación objetivo." #. Tag: title -#: using.docbook:205 +#: using.docbook:206 #, no-c-format msgid "Choosing an object in the target application" msgstr "Escoger un objeto en la aplicación objetivo" #. Tag: para -#: using.docbook:207 +#: using.docbook:208 #, no-c-format msgid "" "When you want to choose an object from the target application a list with " @@ -1181,7 +1206,7 @@ "también muestra la relación padre-hijo entre objetos." #. Tag: para -#: using.docbook:208 +#: using.docbook:209 #, no-c-format msgid "" "The list is updated when there are changes in the target application. For " @@ -1193,7 +1218,7 @@ "diálogo y todos sus hijos se mostrarán en la lista." #. Tag: para -#: using.docbook:209 +#: using.docbook:210 #, no-c-format msgid "" "Usually, the objects used in tutorials are widgets, so when a widget is " @@ -1206,9 +1231,24 @@ "no tienen representación gráfica." #. Tag: para -#: using.docbook:210 +#: using.docbook:211 #, no-c-format msgid "" +"As widgets are the most used objects in tutorials, plain objects can be " +"filtered from the list. In the same way, objects without name can also be " +"filtered. However, some objects may appear in the list even if they should " +"be hidden when they have any descendant that passes the enabled filters." +msgstr "" +"Dado que en los tutoriales los objetos más utilizados son los widgets, los " +"objetos sencillos pueden filtrarse en la lista. Asimismo, también se pueden " +"filtrar los objetos sin nombre. Sin embargo, algunos objetos podrían " +"aparecer en la lista incluso si deberían estar ocultos cuando tienen algún " +"descendiente que sí pasa los filtros activos." + +#. Tag: para +#: using.docbook:212 +#, no-c-format +msgid "" "When the list with the objects is shown, the rest of the &ktutorial-editor; " "windows are hidden. It is made to better view the widgets when they are " "highlighted in the target application. The &ktutorial-editor; windows are " @@ -1221,11 +1261,92 @@ #. Tag: title #: using.docbook:214 #, no-c-format +msgid "Objects with duplicated names" +msgstr "Objetos con nombres duplicados" + +#. Tag: para +#: using.docbook:215 +#, no-c-format +msgid "" +"Usually, the name of an object in the target application will identify that " +"and only that object. However, sometimes there could be two or more objects " +"with the same name. For example, if there are two or more dialogs opened, " +"there will probably be two or more objects named <literal>Ok button</" +"literal>." +msgstr "" +"Generalmente, el nombre de un objeto en la aplicación objetivo identificará " +"a ese objeto y sólo a ese objeto. Sin embargo, en ocasiones podría haber dos " +"o más objetos con el mismo nombre. Por ejemplo, si hay dos o más diálogos " +"abiertos, probablemente haya dos o más objetos llamados <literal>Ok button</" +"literal>." + +#. Tag: para +#: using.docbook:216 +#, no-c-format +msgid "" +"Therefore, when two or more objects have the same name, they can not be " +"identified by their name alone. Instead, their name must be qualified with " +"the name of one or more ancestor objects. For example, " +"<literal>Configuration dialog/Ok button</literal>. When an object is chosen " +"in the list, &ktutorial-editor; takes care of all this and gets a unique " +"name for the object." +msgstr "" +"Por lo tanto, cuando dos o más objetos tienen el mismo nombre no se les " +"puede identificar utilizando únicamente dicho nombre. En cambio, su nombre " +"debe acompañarse con el nombre de uno o más de sus objetos ancestros. Por " +"ejemplo, <literal>Configuration dialog/Ok button</literal>. Cuando se escoge " +"un objeto en la lista, &ktutorial-editor; se encarga de todo esto y escoge " +"un nombre único para el objeto." + +#. Tag: para +#: using.docbook:217 +#, no-c-format +msgid "" +"But note that a name and the object it represents depends on the state of " +"the target application. For example, if there is a dialog named " +"<literal>Configuration dialog</literal> with a button named <literal>Ok " +"button</literal>, its unique name could be just <literal>Ok button</" +"literal>. However, if another dialog named <literal>File information dialog</" +"literal> were opened while the <literal>Configuration dialog</literal> was " +"still opened, and <literal>File information dialog</literal> had a also " +"button called <literal>Ok button</literal>, now the unique name of the first " +"button would be <literal>Configuration dialog/Ok button</literal>. In this " +"situation, <literal>Ok button</literal> would not represent a specific " +"object in the target application." +msgstr "" +"Pero ten en cuenta que el nombre y el objeto al que representa dependen del " +"estado de la aplicación objetivo. Por ejemplo, si hay un diálogo llamado " +"<literal>Configuration dialog</literal> con un botón llamado <literal>Ok " +"button</literal>, su nombre único podría ser simplemente <literal>Ok button</" +"literal>. Sin embargo, si se abriese otro diálogo llamado <literal>File " +"information dialog</literal> cuando el diálogo <literal>Configuration " +"dialog</literal> estuviese abierto, y el diálogo <literal>File information " +"dialog</literal> tuviese también un botón llamado <literal>Ok button</" +"literal>, ahora el nombre único del primer botón sería " +"<literal>Configuration dialog/Ok button</literal>. En esta situación, " +"<literal>Ok button</literal> no representaría a un objeto específico en la " +"aplicación objetivo." + +#. Tag: para +#: using.docbook:218 +#, no-c-format +msgid "" +"All that means that, when choosing an object from the target application, " +"the target application should be in the same state as it would be when " +"following the tutorial and getting to the current step." +msgstr "" +"Todo esto quiere decir que, cuando se seleccione un objeto de la aplicación " +"objetivo, la aplicación objetivo debería estar en el mismo estado en que " +"estará cuando se siga el tutorial y se llegue al paso actual." + +#. Tag: title +#: using.docbook:223 +#, no-c-format msgid "Testing a tutorial in the target application" msgstr "Probar un tutorial en la aplicación objetivo" #. Tag: para -#: using.docbook:216 +#: using.docbook:225 #, no-c-format msgid "" "Designing a tutorial is not a failproof task. Maybe your custom code does " @@ -1240,22 +1361,24 @@ "veces." #. Tag: para -#: using.docbook:217 +#: using.docbook:226 #, no-c-format msgid "" "Exporting the tutorial to the application data directory and then starting " "the target application each time you want to test the tutorial can be very " "tedious. To ease testing the tutorial, &ktutorial-editor; is able to start " -"the tutorial being designed directly in the target application." +"the tutorial being designed directly in the target application. The tutorial " +"can be started from the beginning or from the currently selected step." msgstr "" "Exportar el tutorial al directorio de datos de la aplicación y luego " "arrancar la aplicación objetivo cada vez que quieras probar el tutorial " "puede ser muy tedioso. Para hacer más fácil probar el tutorial, &ktutorial-" "editor; es capaz de empezar el tutorial que se está diseñando directamente " -"en la aplicación objetivo." +"en la aplicación objetivo. El tutorial puede empezarse desde el principio o " +"desde el paso seleccionado actualmente." #. Tag: para -#: using.docbook:218 +#: using.docbook:227 #, no-c-format msgid "" "Note, however, that after closing the tutorial the target application will " @@ -1271,13 +1394,13 @@ "quieres empezarlo desde la aplicación misma." #. Tag: title -#: using.docbook:222 +#: using.docbook:231 #, no-c-format msgid "Other less noticeable features" msgstr "Otras características menos evidentes" #. Tag: para -#: using.docbook:224 +#: using.docbook:233 #, no-c-format msgid "" "Besides those already mentioned, &ktutorial-editor; uses a running target " @@ -1288,7 +1411,7 @@ "igualmente útiles características." #. Tag: para -#: using.docbook:225 +#: using.docbook:234 #, no-c-format msgid "" "The one-line text editors to set the name of an object have text completion, " @@ -1302,22 +1425,39 @@ "el nombre en base a los objetos de la aplicación objetivo." #. Tag: para -#: using.docbook:226 +#: using.docbook:235 #, no-c-format msgid "" "The one-line text editor to set the name of a signal also has text " "completion, so when the object name was set, the text editor will suggest " -"the signal name based on the signals that can be emitted by that object." +"the signal name based on the signals that can be emitted by that object. The " +"same schema is used for the name of properties." msgstr "" "Los editores de texto de una única línea para establecer el nombre de una " "señal también tienen completado de texto, por lo que una vez que se " "establece el nombre del objeto, el editor de texto sugerirá el nombre de la " -"señal en base a las señales que pueden ser emitidas por ese objeto." +"señal en base a las señales que pueden ser emitidas por ese objeto. El " +"nombre de las propiedades sigue este mismo esquema." #. Tag: para -#: using.docbook:227 +#: using.docbook:236 #, no-c-format msgid "" +"The one-line text editors for step ids in the step data and reaction dialogs " +"have text completion too. The first one will suggest the ids not assigned " +"yet (from the <emphasis>change to step</emphasis> field of the reactions), " +"and the second one will suggest the ids already set in the steps." +msgstr "" +"Los editores de texto de una única línea para identificadores de pasos en " +"los diálogos de datos del paso y de reacciones también tienen completado de " +"texto. El primero sugerirá los identificadores que no fueron asignados " +"todavía (del campo <emphasis>cambiar al paso</emphasis> de las reacciones), " +"y el segundo sugerirá los identificadores ya establecidos en los pasos." + +#. Tag: para +#: using.docbook:237 +#, no-c-format +msgid "" "The text completion uses the standard KDE text completion system, so all the " "standard keyboard shortcuts can be used (like <keycombo action=\"simul" "\">&Ctrl;<keycap>T</keycap></keycombo> to show all the available " @@ -1329,25 +1469,25 @@ "todas las propuestas de completado disponibles)." #. Tag: screeninfo -#: using.docbook:230 +#: using.docbook:240 #, no-c-format msgid "An example of text completion for a signal name" msgstr "Un ejemplo de completado de texto para el nombre de una señal" #. Tag: phrase -#: using.docbook:236 +#: using.docbook:246 #, no-c-format msgid "Signal name completion" msgstr "Completado del nombre de una señal" #. Tag: title -#: using.docbook:244 +#: using.docbook:254 #, no-c-format msgid "Saving and loading again the tutorial" msgstr "Guardar y cargar de nuevo el tutorial" #. Tag: para -#: using.docbook:246 +#: using.docbook:256 #, no-c-format msgid "" "&ktutorial-editor; supports saving a tutorial being designed so it can be " @@ -1364,7 +1504,7 @@ "guimenuitem></menuchoice>." #. Tag: para -#: using.docbook:247 +#: using.docbook:257 #, no-c-format msgid "" "Note that tutorials are saved in an XML format specific to &ktutorial-" @@ -1378,7 +1518,7 @@ "\">exportarse</link> para que KTutorial pueda entenderlo." #. Tag: para -#: using.docbook:248 +#: using.docbook:258 #, no-c-format msgid "" "Also note that loading and saving a tutorial does not need to be done from " @@ -1392,7 +1532,7 @@ "(mediante <acronym>FTP</acronym>, <acronym>SSH</acronym>, etc)." #. Tag: para -#: using.docbook:249 +#: using.docbook:259 #, no-c-format msgid "" "When a tutorial is loaded or saved it is added to the recently used file " @@ -1406,13 +1546,13 @@ "una forma rápida de cargar un tutorial usado recientemente de dicha lista." #. Tag: title -#: using.docbook:253 +#: using.docbook:263 #, no-c-format msgid "Exporting the tutorial" msgstr "Exportación del tutorial" #. Tag: para -#: using.docbook:255 +#: using.docbook:265 #, no-c-format msgid "" "Once you have finished designing the tutorial you can export it to a " @@ -1431,7 +1571,7 @@ "\"understanding-ktutorial\"/>." #. Tag: para -#: using.docbook:256 +#: using.docbook:266 #, no-c-format msgid "" "The export dialog also supports exporting to remote directories, although it " @@ -1441,13 +1581,13 @@ "aunque sería muy extraño que necesitases hacer eso." #. Tag: title -#: using.docbook:260 +#: using.docbook:270 #, no-c-format msgid "Command Line Options" msgstr "Opciones de la línea de órdenes" #. Tag: para -#: using.docbook:262 +#: using.docbook:272 #, no-c-format msgid "" "Though &ktutorial-editor; will be usually started from the &kde; program " @@ -1461,7 +1601,7 @@ "disponibles en este caso." #. Tag: para -#: using.docbook:264 +#: using.docbook:274 #, no-c-format msgid "" "Apart from generic &kde; command line options, &ktutorial-editor; optionally " @@ -1471,7 +1611,7 @@ "editor; acepta de manera opcional una URL desde la que cargar un tutorial:" #. Tag: cmdsynopsis -#: using.docbook:265 +#: using.docbook:275 #, no-c-format msgid "" "<command>ktutorial-editor</command> <arg choice=\"opt\" rep=\"norepeat" @@ -1481,7 +1621,7 @@ "\">URL</arg>" #. Tag: para -#: using.docbook:266 +#: using.docbook:276 #, no-c-format msgid "" "The URL does not need to be a local file; remote directories are also " @@ -1491,38 +1631,38 @@ "remotos." #. Tag: title -#: using.docbook:269 +#: using.docbook:279 #, no-c-format msgid "Default &kde; Command Line Options" msgstr "Opciones por defecto de &kde; de la línea de órdenes" #. Tag: para -#: using.docbook:271 +#: using.docbook:281 #, no-c-format msgid "The following command line help options are available:" msgstr "" "Las siguientes opciones de ayuda en la línea de órdenes están disponibles:" #. Tag: command -#: using.docbook:276 +#: using.docbook:286 #, no-c-format msgid "ktutorial-editor <option>--help</option>" msgstr "ktutorial-editor <option>--help</option>" #. Tag: para -#: using.docbook:279 +#: using.docbook:289 #, no-c-format msgid "This lists the most basic options available at the command line." msgstr "Lista las opciones más básicas disponibles en la línea de órdenes." #. Tag: command -#: using.docbook:285 +#: using.docbook:295 #, no-c-format msgid "ktutorial-editor <option>--help-qt</option>" msgstr "ktutorial-editor <option>--help-qt</option>" #. Tag: para -#: using.docbook:288 +#: using.docbook:298 #, no-c-format msgid "" "This lists the options available for changing the way &ktutorial-editor; " @@ -1532,13 +1672,13 @@ "editor; interacciona con &Qt;." #. Tag: command -#: using.docbook:294 +#: using.docbook:304 #, no-c-format msgid "ktutorial-editor <option>--help-kde</option>" msgstr "ktutorial-editor <option>--help-kde</option>" #. Tag: para -#: using.docbook:297 +#: using.docbook:307 #, no-c-format msgid "" "This lists the options available for changing the way &ktutorial-editor; " @@ -1548,37 +1688,37 @@ "editor; interacciona con &kde;." #. Tag: command -#: using.docbook:303 +#: using.docbook:313 #, no-c-format msgid "ktutorial-editor <option>--help-all</option>" msgstr "ktutorial-editor <option>--help-all</option>" #. Tag: para -#: using.docbook:306 +#: using.docbook:316 #, no-c-format msgid "This lists all of the command line options." msgstr "Lista todas las opciones de la línea de órdenes." #. Tag: command -#: using.docbook:312 +#: using.docbook:322 #, no-c-format msgid "ktutorial-editor <option>--author</option>" msgstr "ktutorial-editor <option>--author</option>" #. Tag: para -#: using.docbook:315 +#: using.docbook:325 #, no-c-format msgid "Lists &ktutorial-editor;'s author in the terminal window." msgstr "Lista los autores de &ktutorial-editor; en la terminal." #. Tag: command -#: using.docbook:321 +#: using.docbook:331 #, no-c-format msgid "ktutorial-editor <option>--version</option>" msgstr "ktutorial-editor <option>--version</option>" #. Tag: para -#: using.docbook:324 +#: using.docbook:334 #, no-c-format msgid "" "Lists version information for &Qt;, &kde;, and &ktutorial-editor;. Also " @@ -1589,13 +1729,13 @@ "command>." #. Tag: command -#: using.docbook:330 +#: using.docbook:340 #, no-c-format msgid "ktutorial-editor <option>--license</option>" msgstr "ktutorial-editor <option>--license</option>" #. Tag: para -#: using.docbook:333 +#: using.docbook:343 #, no-c-format msgid "Shows &ktutorial-editor;'s license text in the terminal window." msgstr "Muestra el texto de la licencia de &ktutorial-editor; en la terminal." @@ -1986,14 +2126,34 @@ msgid "Starts the tutorial in the target application." msgstr "Empieza el tutorial en la aplicación objetivo." +#. Tag: menuchoice +#: commands.docbook:343 +#, no-c-format +msgid "" +"<guimenu>Edit</guimenu> <guimenuitem>Test tutorial from current step</" +"guimenuitem>" +msgstr "" +"<guimenu>Editar</guimenu> <guimenuitem>Probar tutorial desde el paso actual<" +"/guimenuitem>" + +#. Tag: action +#: commands.docbook:350 +#, no-c-format +msgid "" +"Starts the tutorial in the target application from the currently selected " +"step." +msgstr "" +"Empieza el tutorial en la aplicación objetivo desde el paso seleccionado " +"actualmente." + #. Tag: title -#: commands.docbook:346 +#: commands.docbook:359 #, no-c-format msgid "The <guimenu>View</guimenu> Menu" msgstr "El menú <guimenu>Ver</guimenu>" #. Tag: menuchoice -#: commands.docbook:351 +#: commands.docbook:364 #, no-c-format msgid "" "<guimenu>View</guimenu> <guimenuitem>Panels</guimenuitem> <guimenuitem>Edit " @@ -2003,7 +2163,7 @@ "<guimenuitem>Editar tutorial</guimenuitem>" #. Tag: action -#: commands.docbook:359 +#: commands.docbook:372 #, no-c-format msgid "Shows or hides the panel with the shorcuts to tutorial edition actions." msgstr "" @@ -2011,7 +2171,7 @@ "del tutorial." #. Tag: menuchoice -#: commands.docbook:365 +#: commands.docbook:378 #, no-c-format msgid "" "<guimenu>View</guimenu> <guimenuitem>Panels</guimenuitem> <guimenuitem>Edit " @@ -2021,7 +2181,7 @@ "<guimenuitem>Editar paso</guimenuitem>" #. Tag: action -#: commands.docbook:373 +#: commands.docbook:386 #, no-c-format msgid "Shows or hides the panel with the shorcuts to step edition actions." msgstr "" @@ -2029,7 +2189,7 @@ "de los pasos." #. Tag: menuchoice -#: commands.docbook:379 +#: commands.docbook:392 #, no-c-format msgid "" "<guimenu>View</guimenu> <guimenuitem>Panels</guimenuitem> <guimenuitem>Edit " @@ -2039,7 +2199,7 @@ "<guimenuitem>Editar reacción</guimenuitem>" #. Tag: action -#: commands.docbook:387 +#: commands.docbook:400 #, no-c-format msgid "Shows or hides the panel with the shorcuts to reaction edition actions." msgstr "" @@ -2047,13 +2207,13 @@ "de las reacciones." #. Tag: title -#: commands.docbook:396 +#: commands.docbook:409 #, no-c-format msgid "The <guimenu>Settings</guimenu> Menu" msgstr "El menú <guimenu>Preferencias</guimenu>" #. Tag: menuchoice -#: commands.docbook:401 +#: commands.docbook:414 #, no-c-format msgid "<guimenu>Settings</guimenu> <guimenuitem>Show Toolbar</guimenuitem>" msgstr "" @@ -2061,13 +2221,13 @@ "herramientas</guimenuitem>" #. Tag: action -#: commands.docbook:408 +#: commands.docbook:421 #, no-c-format msgid "Shows or hides the main toolbar." msgstr "Muestra u oculta la barra de herramientas principal." #. Tag: menuchoice -#: commands.docbook:414 +#: commands.docbook:427 #, no-c-format msgid "<guimenu>Settings</guimenu> <guimenuitem>Show Statusbar</guimenuitem>" msgstr "" @@ -2075,13 +2235,13 @@ "guimenuitem>" #. Tag: action -#: commands.docbook:421 +#: commands.docbook:434 #, no-c-format msgid "Shows or hides the statusbar." msgstr "Muestra u oculta la barra de estado." #. Tag: menuchoice -#: commands.docbook:427 +#: commands.docbook:440 #, no-c-format msgid "" "<guimenu>Settings</guimenu> <guimenuitem>Configure Shortcuts...</guimenuitem>" @@ -2090,13 +2250,13 @@ "rápidos...</guimenuitem>" #. Tag: action -#: commands.docbook:434 +#: commands.docbook:447 #, no-c-format msgid "Opens a configure dialog for binding keys to actions." msgstr "Abre el diálogo de configuración para asociar teclas con acciones." #. Tag: menuchoice -#: commands.docbook:440 +#: commands.docbook:453 #, no-c-format msgid "" "<guimenu>Settings</guimenu> <guimenuitem>Configure Toolbars...</guimenuitem>" @@ -2105,7 +2265,7 @@ "herramientas...</guimenuitem>" #. Tag: action -#: commands.docbook:447 +#: commands.docbook:460 #, no-c-format msgid "" "Opens a configure dialog for selecting the actions to show in the toolbar." @@ -2114,13 +2274,13 @@ "la barra de herramientas." #. Tag: title -#: commands.docbook:456 +#: commands.docbook:469 #, no-c-format msgid "The <guimenu>Help</guimenu> Menu" msgstr "El menú <guimenu>Ayuda</guimenu>" #. Tag: sect2 -#: commands.docbook:456 +#: commands.docbook:469 #, no-c-format msgid "&help.menu.documentation;" msgstr "&help.menu.documentation;" @@ -2252,15 +2412,14 @@ msgid "" "<prompt>$</prompt> <userinput><command>mkdir</command> build && " "<command>cd</command> build</userinput>\n" -" <prompt>$</prompt> <userinput><command>cmake</command> ..</" -"userinput>\n" -" <prompt>$</prompt> <userinput><command>make</command></userinput>" +"<prompt>$</prompt> <userinput><command>cmake</command> ..</userinput>\n" +"<prompt>$</prompt> <userinput><command>make</command></userinput>" msgstr "" "<prompt>$</prompt> <userinput><command>mkdir</command> build && " "<command>cd</command> build</userinput>\n" -" <prompt>$</prompt> <userinput><command>cmake</command> ..</" +"<prompt>$</prompt> <userinput><command>cmake</command> ..</" "userinput>\n" -" <prompt>$</prompt> <userinput><command>make</command></userinput>" +"<prompt>$</prompt> <userinput><command>make</command></userinput>" #. Tag: para #: installation.docbook:39 Modified: trunk/ktutorial/ktutorial-editor/doc/es/new-condition.png =================================================================== (Binary files differ) Modified: trunk/ktutorial/ktutorial-editor/doc/es/set-step-data.png =================================================================== (Binary files differ) Modified: trunk/ktutorial/ktutorial-editor/doc/header.pot =================================================================== --- trunk/ktutorial/ktutorial-editor/doc/header.pot 2011-06-17 01:49:37 UTC (rev 327) +++ trunk/ktutorial/ktutorial-editor/doc/header.pot 2011-06-17 01:51:56 UTC (rev 328) @@ -9,7 +9,7 @@ "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: http://sourceforge.net/tracker/?" "group_id=301227&atid=1270278\n" -"POT-Creation-Date: 2010-10-29 21:49+0000\n" +"POT-Creation-Date: 2011-06-15 15:47+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL...@li...>\n" Modified: trunk/ktutorial/ktutorial-editor/doc/ktutorial-editor-handbook.pot =================================================================== --- trunk/ktutorial/ktutorial-editor/doc/ktutorial-editor-handbook.pot 2011-06-17 01:49:37 UTC (rev 327) +++ trunk/ktutorial/ktutorial-editor/doc/ktutorial-editor-handbook.pot 2011-06-17 01:51:56 UTC (rev 328) @@ -9,7 +9,7 @@ "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: http://sourceforge.net/tracker/?" "group_id=301227&atid=1270278\n" -"POT-Creation-Date: 2010-10-29 21:49+0000\n" +"POT-Creation-Date: 2011-06-15 15:47+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL...@li...>\n" @@ -558,16 +558,29 @@ msgstr "" #. Tag: para -#: using.docbook:116 +#: using.docbook:115 #, no-c-format msgid "" +"To ease all these things, &ktutorial-editor; provides several buttons in the " +"step data dialog that help writing KDE semantic markup tags. These buttons " +"insert the start and end tags for an element as needed, and are enabled or " +"disabled based on the position of the cursor in the text. For example, the " +"button to insert a paragraph tag will be disabled if the cursor is inside a " +"link, but the button to insert a link tag will be enabled if the cursor is " +"inside a paragraph." +msgstr "" + +#. Tag: para +#: using.docbook:117 +#, no-c-format +msgid "" "The step data dialog is also shown when a new step is added. If the dialog " "is accepted, the step is added. If the dialog is cancelled, the step is not " "added." msgstr "" #. Tag: para -#: using.docbook:117 +#: using.docbook:118 #, no-c-format msgid "" "Also note that, in every tutorial, there must be one step with id " @@ -575,19 +588,19 @@ msgstr "" #. Tag: screeninfo -#: using.docbook:120 +#: using.docbook:121 #, no-c-format msgid "The dialog to set the id and text of a step" msgstr "" #. Tag: phrase -#: using.docbook:126 +#: using.docbook:127 #, no-c-format msgid "Step data edition dialog" msgstr "" #. Tag: para -#: using.docbook:131 +#: using.docbook:132 #, no-c-format msgid "" "The setup and tear down code dialogs behave like the tutorial ones. The only " @@ -596,7 +609,7 @@ msgstr "" #. Tag: para -#: using.docbook:132 +#: using.docbook:133 #, no-c-format msgid "" "Also note that the exported scripted tutorial creates all the reactions in " @@ -604,13 +617,13 @@ msgstr "" #. Tag: title -#: using.docbook:136 +#: using.docbook:137 #, no-c-format msgid "Reaction edition" msgstr "" #. Tag: para -#: using.docbook:138 +#: using.docbook:139 #, no-c-format msgid "" "The reaction dialog is used to set the trigger and response of a reaction. " @@ -619,7 +632,7 @@ msgstr "" #. Tag: para -#: using.docbook:139 +#: using.docbook:140 #, no-c-format msgid "" "The trigger can be either an option selected or a condition met, but not " @@ -630,7 +643,7 @@ msgstr "" #. Tag: para -#: using.docbook:140 +#: using.docbook:141 #, no-c-format msgid "" "Likely, the response can be changing to another step or executing some " @@ -641,25 +654,25 @@ msgstr "" #. Tag: screeninfo -#: using.docbook:143 +#: using.docbook:144 #, no-c-format msgid "The dialog to set the trigger and response of a reaction" msgstr "" #. Tag: phrase -#: using.docbook:149 +#: using.docbook:150 #, no-c-format msgid "Set reaction data edition dialog" msgstr "" #. Tag: title -#: using.docbook:155 +#: using.docbook:156 #, no-c-format msgid "Condition edition" msgstr "" #. Tag: para -#: using.docbook:157 +#: using.docbook:158 #, no-c-format msgid "" "The condition that acts as a trigger of a reaction can be a simple condition " @@ -670,7 +683,7 @@ msgstr "" #. Tag: para -#: using.docbook:158 +#: using.docbook:159 #, no-c-format msgid "" "Due to this, conditions are represented in a tree, and it also affects how " @@ -678,7 +691,7 @@ msgstr "" #. Tag: para -#: using.docbook:159 +#: using.docbook:160 #, no-c-format msgid "" "A condition can be added as the root condition when there are no other " @@ -689,29 +702,31 @@ msgstr "" #. Tag: screeninfo -#: using.docbook:162 +#: using.docbook:163 #, no-c-format msgid "The dialog to select the type of the new condition to add" msgstr "" #. Tag: phrase -#: using.docbook:168 +#: using.docbook:169 #, no-c-format msgid "New condition dialog" msgstr "" #. Tag: para -#: using.docbook:173 +#: using.docbook:174 #, no-c-format msgid "" -"Only simple conditions (waiting for an event, waiting for a signal and " -"waiting for a window to be shown) can be edited, showing specific dialogs " -"for it. Composed conditions only group other conditions, so they don't have " -"properties to be edited." +"Only simple conditions (waiting for an event, waiting for a signal, waiting " +"for a window to be shown and waiting for a property to have certain value) " +"can be edited, showing specific dialogs for it. Composed conditions only " +"group other conditions, so they don't have properties to be edited. The " +"condition to wait for its step to be activated, despite being a simple " +"condition, can not be edited either." msgstr "" #. Tag: para -#: using.docbook:174 +#: using.docbook:175 #, no-c-format msgid "" "Any condition can be removed from its parent composed condition, or from the " @@ -719,7 +734,7 @@ msgstr "" #. Tag: para -#: using.docbook:176 +#: using.docbook:177 #, no-c-format msgid "" "There is a special type of condition that verifies that its negated " @@ -733,13 +748,13 @@ msgstr "" #. Tag: title -#: using.docbook:179 +#: using.docbook:180 #, no-c-format msgid "Conditions and modal dialogs" msgstr "" #. Tag: para -#: using.docbook:180 +#: using.docbook:181 #, no-c-format msgid "" "Modal dialogs are those that block the interaction with the windows of the " @@ -751,7 +766,7 @@ msgstr "" #. Tag: para -#: using.docbook:181 +#: using.docbook:182 #, no-c-format msgid "" "Take, for example, an <emphasis>Open file</emphasis> dialog. If the " @@ -764,7 +779,7 @@ msgstr "" #. Tag: para -#: using.docbook:182 +#: using.docbook:183 #, no-c-format msgid "" "The condition to wait for windows to be shown supports both windows and " @@ -774,13 +789,13 @@ msgstr "" #. Tag: title -#: using.docbook:189 +#: using.docbook:190 #, no-c-format msgid "Interacting with the target application" msgstr "" #. Tag: para -#: using.docbook:191 +#: using.docbook:192 #, no-c-format msgid "" "When a tutorial is being designed it is usually necessary to know some " @@ -791,7 +806,7 @@ msgstr "" #. Tag: para -#: using.docbook:192 +#: using.docbook:193 #, no-c-format msgid "" "To help with this problem &ktutorial-editor; is able to \"talk\" with any " @@ -802,7 +817,7 @@ msgstr "" #. Tag: para -#: using.docbook:193 +#: using.docbook:194 #, no-c-format msgid "" "Note, however, that the intercommunication system between &ktutorial-editor; " @@ -813,13 +828,13 @@ msgstr "" #. Tag: title -#: using.docbook:196 +#: using.docbook:197 #, no-c-format msgid "Starting the target application" msgstr "" #. Tag: para -#: using.docbook:198 +#: using.docbook:199 #, no-c-format msgid "" "&ktutorial-editor; requires an instance of the target application to be " @@ -828,7 +843,7 @@ msgstr "" #. Tag: para -#: using.docbook:199 +#: using.docbook:200 #, no-c-format msgid "" "So, how can the target application be started from &ktutorial-editor;? When " @@ -839,7 +854,7 @@ msgstr "" #. Tag: para -#: using.docbook:200 +#: using.docbook:201 #, no-c-format msgid "" "Note that the application list contains all the known KDE applications in " @@ -849,7 +864,7 @@ msgstr "" #. Tag: para -#: using.docbook:201 +#: using.docbook:202 #, no-c-format msgid "" "Once a valid target application has been specified it will be used " @@ -859,13 +874,13 @@ msgstr "" #. Tag: title -#: using.docbook:205 +#: using.docbook:206 #, no-c-format msgid "Choosing an object in the target application" msgstr "" #. Tag: para -#: using.docbook:207 +#: using.docbook:208 #, no-c-format msgid "" "When you want to choose an object from the target application a list with " @@ -876,7 +891,7 @@ msgstr "" #. Tag: para -#: using.docbook:208 +#: using.docbook:209 #, no-c-format msgid "" "The list is updated when there are changes in the target application. For " @@ -885,7 +900,7 @@ msgstr "" #. Tag: para -#: using.docbook:209 +#: using.docbook:210 #, no-c-format msgid "" "Usually, the objects used in tutorials are widgets, so when a widget is " @@ -894,9 +909,19 @@ msgstr "" #. Tag: para -#: using.docbook:210 +#: using.docbook:211 #, no-c-format msgid "" +"As widgets are the most used objects in tutorials, plain objects can be " +"filtered from the list. In the same way, objects without name can also be " +"filtered. However, some objects may appear in the list even if they should " +"be hidden when they have any descendant that passes the enabled filters." +msgstr "" + +#. Tag: para +#: using.docbook:212 +#, no-c-format +msgid "" "When the list with the objects is shown, the rest of the &ktutorial-editor; " "windows are hidden. It is made to better view the widgets when they are " "highlighted in the target application. The &ktutorial-editor; windows are " @@ -906,13 +931,68 @@ #. Tag: title #: using.docbook:214 #, no-c-format -msgid "Testing a tutorial in the target application" +msgid "Objects with duplicated names" msgstr "" #. Tag: para +#: using.docbook:215 +#, no-c-format +msgid "" +"Usually, the name of an object in the target application will identify that " +"and only that object. However, sometimes there could be two or more objects " +"with the same name. For example, if there are two or more dialogs opened, " +"there will probably be two or more objects named <literal>Ok button</" +"literal>." +msgstr "" + +#. Tag: para #: using.docbook:216 #, no-c-format msgid "" +"Therefore, when two or more objects have the same name, they can not be " +"identified by their name alone. Instead, their name must be qualified with " +"the name of one or more ancestor objects. For example, " +"<literal>Configuration dialog/Ok button</literal>. When an object is chosen " +"in the list, &ktutorial-editor; takes care of all this and gets a unique " +"name for the object." +msgstr "" + +#. Tag: para +#: using.docbook:217 +#, no-c-format +msgid "" +"But note that a name and the object it represents depends on the state of " +"the target application. For example, if there is a dialog named " +"<literal>Configuration dialog</literal> with a button named <literal>Ok " +"button</literal>, its unique name could be just <literal>Ok button</" +"literal>. However, if another dialog named <literal>File information dialog</" +"literal> were opened while the <literal>Configuration dialog</literal> was " +"still opened, and <literal>File information dialog</literal> had a also " +"button called <literal>Ok button</literal>, now the unique name of the first " +"button would be <literal>Configuration dialog/Ok button</literal>. In this " +"situation, <literal>Ok button</literal> would not represent a specific " +"object in the target application." +msgstr "" + +#. Tag: para +#: using.docbook:218 +#, no-c-format +msgid "" +"All that means that, when choosing an object from the target application, " +"the target application should be in the same state as it would be when " +"following the tutorial and getting to the current step." +msgstr "" + +#. Tag: title +#: using.docbook:223 +#, no-c-format +msgid "Testing a tutorial in the target application" +msgstr "" + +#. Tag: para +#: using.docbook:225 +#, no-c-format +msgid "" "Designing a tutorial is not a failproof task. Maybe your custom code does " "not work as expected, or you are not waiting for the right signal to be " "emitted, or you forgot some step, or... so the tutorial will have to be " @@ -920,17 +1000,18 @@ msgstr "" #. Tag: para -#: using.docbook:217 +#: using.docbook:226 #, no-c-format msgid "" "Exporting the tutorial to the application data directory and then starting " "the target application each time you want to test the tutorial can be very " "tedious. To ease testing the tutorial, &ktutorial-editor; is able to start " -"the tutorial being designed directly in the target application." +"the tutorial being designed directly in the target application. The tutorial " +"can be started from the beginning or from the currently selected step." msgstr "" #. Tag: para -#: using.docbook:218 +#: using.docbook:227 #, no-c-format msgid "" "Note, however, that after closing the tutorial the target application will " @@ -941,13 +1022,13 @@ msgstr "" #. Tag: title -#: using.docbook:222 +#: using.docbook:231 #, no-c-format msgid "Other less noticeable features" msgstr "" #. Tag: para -#: using.docbook:224 +#: using.docbook:233 #, no-c-format msgid "" "Besides those already mentioned, &ktutorial-editor; uses a running target " @@ -955,7 +1036,7 @@ msgstr "" #. Tag: para -#: using.docbook:225 +#: using.docbook:234 #, no-c-format msgid "" "The one-line text editors to set the name of an object have text completion, " @@ -965,18 +1046,29 @@ msgstr "" #. Tag: para -#: using.docbook:226 +#: using.docbook:235 #, no-c-format msgid "" "The one-line text editor to set the name of a signal also has text " "completion, so when the object name was set, the text editor will suggest " -"the signal name based on the signals that can be emitted by that object." +"the signal name based on the signals that can be emitted by that object. The " +"same schema is used for the name of properties." msgstr "" #. Tag: para -#: using.docbook:227 +#: using.docbook:236 #, no-c-format msgid "" +"The one-line text editors for step ids in the step data and reaction dialogs " +"have text completion too. The first one will suggest the ids not assigned " +"yet (from the <emphasis>change to step</emphasis> field of the reactions), " +"and the second one will suggest the ids already set in the steps." +msgstr "" + +#. Tag: para +#: using.docbook:237 +#, no-c-format +msgid "" "The text completion uses the standard KDE text completion system, so all the " "standard keyboard shortcuts can be used (like <keycombo action=\"simul" "\">&Ctrl;<keycap>T</keycap></keycombo> to show all the available " @@ -984,25 +1076,25 @@ msgstr "" #. Tag: screeninfo -#: using.docbook:230 +#: using.docbook:240 #, no-c-format msgid "An example of text completion for a signal name" msgstr "" #. Tag: phrase -#: using.docbook:236 +#: using.docbook:246 #, no-c-format msgid "Signal name completion" msgstr "" #. Tag: title -#: using.docbook:244 +#: using.docbook:254 #, no-c-format msgid "Saving and loading again the tutorial" msgstr "" #. Tag: para -#: using.docbook:246 +#: using.docbook:256 #, no-c-format msgid "" "&ktutorial-editor; supports saving a tutorial being designed so it can be " @@ -1013,7 +1105,7 @@ msgstr "" #. Tag: para -#: using.docbook:247 +#: using.docbook:257 #, no-c-format msgid "" "Note that tutorials are saved in an XML format specific to &ktutorial-" @@ -1023,7 +1115,7 @@ msgstr "" #. Tag: para -#: using.docbook:248 +#: using.docbook:258 #, no-c-format msgid "" "Also note that loading and saving a tutorial does not need to be done from " @@ -1033,7 +1125,7 @@ msgstr "" #. Tag: para -#: using.docbook:249 +#: using.docbook:259 #, no-c-format msgid "" "When a tutorial is loaded or saved it is added to the recently used file " @@ -1043,13 +1135,13 @@ msgstr "" #. Tag: title -#: using.docbook:253 +#: using.docbook:263 #, no-c-format msgid "Exporting the tutorial" msgstr "" #. Tag: para -#: using.docbook:255 +#: using.docbook:265 #, no-c-format msgid "" "Once you have finished designing the tutorial you can export it to a " @@ -1061,7 +1153,7 @@ msgstr "" #. Tag: para -#: using.docbook:256 +#: using.docbook:266 #, no-c-format msgid "" "The export dialog also supports exporting to remote directories, although it " @@ -1069,13 +1161,13 @@ msgstr "" #. Tag: title -#: using.docbook:260 +#: using.docbook:270 #, no-c-format msgid "Command Line Options" msgstr "" #. Tag: para -#: using.docbook:262 +#: using.docbook:272 #, no-c-format msgid "" "Though &ktutorial-editor; will be usually started from the &kde; program " @@ -1085,7 +1177,7 @@ msgstr "" #. Tag: para -#: using.docbook:264 +#: using.docbook:274 #, no-c-format msgid "" "Apart from generic &kde; command line options, &ktutorial-editor; optionally " @@ -1093,7 +1185,7 @@ msgstr "" #. Tag: cmdsynopsis -#: using.docbook:265 +#: using.docbook:275 #, no-c-format msgid "" "<command>ktutorial-editor</command> <arg choice=\"opt\" rep=\"norepeat" @@ -1101,7 +1193,7 @@ msgstr "" #. Tag: para -#: using.docbook:266 +#: using.docbook:276 #, no-c-format msgid "" "The URL does not need to be a local file; remote directories are also " @@ -1109,37 +1201,37 @@ msgstr "" #. Tag: title -#: using.docbook:269 +#: using.docbook:279 #, no-c-format msgid "Default &kde; Command Line Options" msgstr "" #. Tag: para -#: using.docbook:271 +#: using.docbook:281 #, no-c-format msgid "The following command line help options are available:" msgstr "" #. Tag: command -#: using.docbook:276 +#: using.docbook:286 #, no-c-format msgid "ktutorial-editor <option>--help</option>" msgstr "" #. Tag: para -#: using.docbook:279 +#: using.docbook:289 #, no-c-format msgid "This lists the most basic options available at the command line." msgstr "" #. Tag: command -#: using.docbook:285 +#: using.docbook:295 #, no-c-format msgid "ktutorial-editor <option>--help-qt</option>" msgstr "" #. Tag: para -#: using.docbook:288 +#: using.docbook:298 #, no-c-format msgid "" "This lists the options available for changing the way &ktutorial-editor; " @@ -1147,13 +1239,13 @@ msgstr "" #. Tag: command -#: using.docbook:294 +#: using.docbook:304 #, no-c-format msgid "ktutorial-editor <option>--help-kde</option>" msgstr "" #. Tag: para -#: using.docbook:297 +#: using.docbook:307 #, no-c-format msgid "" "This lists the options available for changing the way &ktutorial-editor; " @@ -1161,37 +1253,37 @@ msgstr "" #. Tag: command -#: using.docbook:303 +#: using.docbook:313 #, no-c-format msgid "ktutorial-editor <option>--help-all</option>" msgstr "" #. Tag: para -#: using.docbook:306 +#: using.docbook:316 #, no-c-format msgid "This lists all of the command line options." msgstr "" #. Tag: command -#: using.docbook:312 +#: using.docbook:322 #, no-c-format msgid "ktutorial-editor <option>--author</option>" msgstr "" #. Tag: para -#: using.docbook:315 +#: using.docbook:325 #, no-c-format msgid "Lists &ktutorial-editor;'s author in the terminal window." msgstr "" #. Tag: command -#: using.docbook:321 +#: using.docbook:331 #, no-c-format msgid "ktutorial-editor <option>--version</option>" msgstr "" #. Tag: para -#: using.docbook:324 +#: using.docbook:334 #, no-c-format msgid "" "Lists version information for &Qt;, &kde;, and &ktutorial-editor;. Also " @@ -1199,13 +1291,13 @@ msgstr "" #. Tag: command -#: using.docbook:330 +#: using.docbook:340 #, no-c-format msgid "ktutorial-editor <option>--license</option>" msgstr "" #. Tag: para -#: using.docbook:333 +#: using.docbook:343 #, no-c-format msgid "Shows &ktutorial-editor;'s license text in the terminal window." msgstr "" @@ -1545,14 +1637,30 @@ msgid "Starts the tutorial in the target application." msgstr "" +#. Tag: menuchoice +#: commands.docbook:343 +#, no-c-format +msgid "" +"<guimenu>Edit</guimenu> <guimenuitem>Test tutorial from current step</" +"guimenuitem>" +msgstr "" + +#. Tag: action +#: commands.docbook:350 +#, no-c-format +msgid "" +"Starts the tutorial in the target application from the currently selected " +"step." +msgstr "" + #. Tag: title -#: commands.docbook:346 +#: commands.docbook:359 #, no-c-format msgid "The <guimenu>View</guimenu> Menu" msgstr "" #. Tag: menuchoice -#: commands.docbook:351 +#: commands.docbook:364 #, no-c-format msgid "" "<guimenu>View</guimenu> <guimenuitem>Panels</guimenuitem> <guimenuitem>Edit " @@ -1560,13 +1668,13 @@ msgstr "" #. Tag: action -#: commands.docbook:359 +#: commands.docbook:372 #, no-c-format msgid "Shows or hides the panel with the shorcuts to tutorial edition actions." msgstr "" #. Tag: menuchoice -#: commands.docbook:365 +#: commands.docbook:378 #, no-c-format msgid "" "<guimenu>View</guimenu> <guimenuitem>Panels</guimenuitem> <guimenuitem>Edit " @@ -1574,13 +1682,13 @@ msgstr "" #. Tag: action -#: commands.docbook:373 +#: commands.docbook:386 #, no-c-format msgid "Shows or hides the panel with the shorcuts to step edition actions." msgstr "" #. Tag: menuchoice -#: commands.docbook:379 +#: commands.docbook:392 #, no-c-format msgid "" "<guimenu>View</guimenu> <guimenuitem>Panels</guimenuitem> <guimenuitem>Edit " @@ -1588,76 +1696,76 @@ msgstr "" #. Tag: action -#: commands.docbook:387 +#: commands.docbook:400 #, no-c-format msgid "Shows or hides the panel with the shorcuts to reaction edition actions." msgstr "" #. Tag: title -#: commands.docbook:396 +#: commands.docbook:409 #, no-c-format msgid "The <guimenu>Settings</guimenu> Menu" msgstr "" #. Tag: menuchoice -#: commands.docbook:401 +#: commands.docbook:414 #, no-c-format msgid "<guimenu>Settings</guimenu> <guimenuitem>Show Toolbar</guimenuitem>" msgstr "" #. Tag: action -#: commands.docbook:408 +#: commands.docbook:421 #, no-c-format msgid "Shows or hides the main toolbar." msgstr "" #. Tag: menuchoice -#: commands.docbook:414 +#: commands.docbook:427 #, no-c-format msgid "<guimenu>Settings</guimenu> <guimenuitem>Show Statusbar</guimenuitem>" msgstr "" #. Tag: action -#: commands.docbook:421 +#: commands.docbook:434 #, no-c-format msgid "Shows or hides the statusbar." msgstr "" #. Tag: menuchoice -#: commands.docbook:427 +#: commands.docbook:440 #, no-c-format msgid "" "<guimenu>Settings</guimenu> <guimenuitem>Configure Shortcuts...</guimenuitem>" msgstr "" #. Tag: action -#: commands.docbook:434 +#: commands.docbook:447 #, no-c-format msgid "Opens a configure dialog for binding keys to actions." msgstr "" #. Tag: menuchoice -#: commands.docbook:440 +#: commands.docbook:453 #, no-c-format msgid "" "<guimenu>Settings</guimenu> <guimenuitem>Configure Toolbars...</guimenuitem>" msgstr "" #. Tag: action -#: commands.docbook:447 +#: commands.docbook:460 #, no-c-format msgid "" "Opens a configure dialog for selecting the actions to show in the toolbar." msgstr "" #. Tag: title -#: commands.docbook:456 +#: commands.docbook:469 #, no-c-format msgid "The <guimenu>Help</guimenu> Menu" msgstr "" #. Tag: sect2 -#: commands.docbook:456 +#: commands.docbook:469 #, no-c-format msgid "&help.menu.documentation;" msgstr "" @@ -1764,9 +1872,8 @@ msgid "" "<prompt>$</prompt> <userinput><command>mkdir</command> build && " "<command>cd</command> build</userinput>\n" -" <prompt>$</prompt> <userinput><command>cmake</command> ..</" -"userinput>\n" -" <prompt>$</prompt> <userinput><command>make</command></userinput>" +"<prompt>$</prompt> <userinput><command>cmake</command> ..</userinput>\n" +"<prompt>$</prompt> <userinput><command>make</command></userinput>" msgstr "" #. Tag: para Modified: trunk/ktutorial/ktutorial-editor/po/es.po =================================================================== --- trunk/ktutorial/ktutorial-editor/po/es.po 2011-06-17 01:49:37 UTC (rev 327) +++ trunk/ktutorial/ktutorial-editor/po/es.po 2011-06-17 01:51:56 UTC (rev 328) @@ -3,14 +3,14 @@ # Copyright (C) 2010 Daniel Calviño Sánchez # This file is distributed under the same license as the ktutorial-editor package. # -# Daniel Calviño Sánchez <dan...@gm...>, 2010. +# Daniel Calviño Sánchez <dan...@gm...>, 2010, 2011. msgid "" msgstr "" "Project-Id-Version: ktutorial-editor\n" "Report-Msgid-Bugs-To: http://sourceforge." "net/tracker/?group_id=301227&atid=1270278\n" -"POT-Creation-Date: 2010-10-29 23:49+0200\n" -"PO-Revision-Date: 2010-10-29 23:49+0200\n" +"POT-Creation-Date: 2011-06-15 15:24+0200\n" +"PO-Revision-Date: 2011-06-15 15:26+0200\n" "Last-Translator: Daniel Calviño Sánchez <dan...@gm...>\n" "Language-Team: Spanish <>\n" "MIME-Version: 1.0\n" @@ -69,12 +69,12 @@ msgid "Set step tear down code" msgstr "Establecer el código de finalización del paso" -#: commands/StepCommands.cpp:141 EditActions.cpp:303 +#: commands/StepCommands.cpp:141 EditActions.cpp:290 msgctxt "@action" msgid "Add reaction" msgstr "Añadir reacción" -#: commands/StepCommands.cpp:186 EditActions.cpp:207 +#: commands/StepCommands.cpp:186 EditActions.cpp:203 msgctxt "@action" msgid "Remove reaction" msgstr "Eliminar reacción" @@ -104,79 +104,79 @@ msgid "Set tutorial tear down code" msgstr "Establecer el código de finalización del tutorial" -#: commands/TutorialCommands.cpp:164 EditActions.cpp:264 +#: commands/TutorialCommands.cpp:164 EditActions.cpp:248 msgctxt "@action" msgid "Add step" msgstr "Añadir paso" -#: commands/TutorialCommands.cpp:209 EditActions.cpp:180 +#: commands/TutorialCommands.cpp:209 EditActions.cpp:176 msgctxt "@action" msgid "Remove step" msgstr "Eliminar paso" -#: EditActions.cpp:111 +#: EditActions.cpp:107 msgctxt "@action" msgid "Set information..." msgstr "Establecer información..." -#: EditActions.cpp:112 +#: EditActions.cpp:108 msgctxt "@info:status" msgid "Set the name and description of the tutorial." msgstr "Establecer el nombre y la descripción del tutorial." -#: EditActions.cpp:120 +#: EditActions.cpp:116 msgctxt "@action" msgid "Set license..." msgstr "Establecer licencia..." -#: EditActions.cpp:121 +#: EditActions.cpp:117 msgctxt "@info:status" msgid "Set the license text of the tutorial." msgstr "Establecer el texto de licencia del tutorial." -#: EditActions.c... [truncated message content] |
From: <dan...@us...> - 2011-06-17 01:49:43
|
Revision: 327 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=327&view=rev Author: danxuliu Date: 2011-06-17 01:49:37 +0000 (Fri, 17 Jun 2011) Log Message: ----------- Update English handbook. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/doc/en/commands.docbook trunk/ktutorial/ktutorial-editor/doc/en/installation.docbook trunk/ktutorial/ktutorial-editor/doc/en/new-condition.png trunk/ktutorial/ktutorial-editor/doc/en/set-step-data.png trunk/ktutorial/ktutorial-editor/doc/en/using.docbook Modified: trunk/ktutorial/ktutorial-editor/doc/en/commands.docbook =================================================================== --- trunk/ktutorial/ktutorial-editor/doc/en/commands.docbook 2011-06-17 01:46:54 UTC (rev 326) +++ trunk/ktutorial/ktutorial-editor/doc/en/commands.docbook 2011-06-17 01:49:37 UTC (rev 327) @@ -338,6 +338,19 @@ </para> </listitem> </varlistentry> + <varlistentry> + <term> + <menuchoice> + <guimenu>Edit</guimenu> + <guimenuitem>Test tutorial from current step</guimenuitem> + </menuchoice> + </term> + <listitem> + <para> + <action>Starts the tutorial in the target application from the currently selected step.</action> + </para> + </listitem> + </varlistentry> </variablelist> </para> </sect2> Modified: trunk/ktutorial/ktutorial-editor/doc/en/installation.docbook =================================================================== --- trunk/ktutorial/ktutorial-editor/doc/en/installation.docbook 2011-06-17 01:46:54 UTC (rev 326) +++ trunk/ktutorial/ktutorial-editor/doc/en/installation.docbook 2011-06-17 01:49:37 UTC (rev 327) @@ -34,19 +34,15 @@ <para>In order to compile KTutorial on your system, extract the KTutorial package you downloaded and type the following in the base directory of the extracted package:</para> - <screen> - <prompt>$</prompt> <userinput><command>mkdir</command> build && <command>cd</command> build</userinput> - <prompt>$</prompt> <userinput><command>cmake</command> ..</userinput> - <prompt>$</prompt> <userinput><command>make</command></userinput> - </screen> + <screen><prompt>$</prompt> <userinput><command>mkdir</command> build && <command>cd</command> build</userinput> +<prompt>$</prompt> <userinput><command>cmake</command> ..</userinput> +<prompt>$</prompt> <userinput><command>make</command></userinput></screen> <para>That will create a <filename class="directory">build</filename> directory, change to it, prepare the build directory to build KTutorial on it and finally build KTutorial. If <command>cmake</command> complains, you have to install the required dependencies asked in the error message.</para> <para>To install KTutorial, become root user and run:</para> - <screen> - <prompt>#</prompt> <userinput><command>make</command> install</userinput> - </screen> + <screen><prompt>#</prompt> <userinput><command>make</command> install</userinput></screen> <tip> <title>Installing &ktutorial-editor; in <filename class="directory">/usr/local/</filename></title> @@ -55,9 +51,7 @@ <para>This is the directory that should be used for manually installed packages. To do this, instead of executing <command>cmake</command> as stated before, execute this:</para> - <screen> - <prompt>$</prompt> <userinput><command>cmake</command> <parameter class="command">-DCMAKE_INSTALL_PREFIX=<filename class="directory">/usr/local/</filename></parameter></userinput> - </screen> + <screen><prompt>$</prompt> <userinput><command>cmake</command> <parameter class="command">-DCMAKE_INSTALL_PREFIX=<filename class="directory">/usr/local/</filename></parameter></userinput></screen> </tip> </sect1> Modified: trunk/ktutorial/ktutorial-editor/doc/en/new-condition.png =================================================================== (Binary files differ) Modified: trunk/ktutorial/ktutorial-editor/doc/en/set-step-data.png =================================================================== (Binary files differ) Modified: trunk/ktutorial/ktutorial-editor/doc/en/using.docbook =================================================================== --- trunk/ktutorial/ktutorial-editor/doc/en/using.docbook 2011-06-17 01:46:54 UTC (rev 326) +++ trunk/ktutorial/ktutorial-editor/doc/en/using.docbook 2011-06-17 01:49:37 UTC (rev 327) @@ -121,6 +121,7 @@ <title>Rich text and widget higlighting</title> <para>When writing the text of a step you can use the <ulink url="http://doc.trolltech.com/richtext-html-subset.html">supported subset of HTML tags</ulink> or the <ulink url="http://techbase.kde.org/Development/Tutorials/Localization/i18n_Semantics#Semantic_Tags">KDE semantic markup tags</ulink> to enrich the text. For example, <emphasis><strong>Hello world!</strong></emphasis> will appear as <emphasis role="strong">Hello world!</emphasis> when shown in the tutorial.</para> <para>KTutorial also provides a special type of link that highlights the referenced widget in order to be found easily. For example, <emphasis><a href="widget:theWidgetObjectName">this is a link</a></emphasis> (if the HTML subset is used) or <emphasis><link url="widget:theWidgetObjectName">this is a link</link></emphasis> (if KDE semantic markup is used) will show <emphasis>this is a link</emphasis> with a link appearance (underlined and with some special color) and, when the link is clicked, the widget with the given object name will be highlighted. Clicking the link again will stop highlighting the widget.</para> + <para>To ease all these things, &ktutorial-editor; provides several buttons in the step data dialog that help writing KDE semantic markup tags. These buttons insert the start and end tags for an element as needed, and are enabled or disabled based on the position of the cursor in the text. For example, the button to insert a paragraph tag will be disabled if the cursor is inside a link, but the button to insert a link tag will be enabled if the cursor is inside a paragraph.</para> </tip> <para>The step data dialog is also shown when a new step is added. If the dialog is accepted, the step is added. If the dialog is cancelled, the step is not added.</para> <para>Also note that, in every tutorial, there must be one step with id <emphasis>start</emphasis>, so KTutorial knows where to start the tutorial.</para> @@ -179,7 +180,7 @@ </mediaobject> </screenshot> - <para>Only simple conditions (waiting for an event, waiting for a signal and waiting for a window to be shown) can be edited, showing specific dialogs for it. Composed conditions only group other conditions, so they don't have properties to be edited.</para> + <para>Only simple conditions (waiting for an event, waiting for a signal, waiting for a window to be shown and waiting for a property to have certain value) can be edited, showing specific dialogs for it. Composed conditions only group other conditions, so they don't have properties to be edited. The condition to wait for its step to be activated, despite being a simple condition, can not be edited either.</para> <para>Any condition can be removed from its parent composed condition, or from the reaction if it is the root condition.</para> <para>There is a special type of condition that verifies that its negated condition wasn't met which purpose is to be used only as a child of a composed condition that waits until all its child conditions were met. The idea is that, when the negated condition wasn't met, the special condition is met. When the negated condition is met, the special condition is no longer met. It can be used, for example, to make a reaction wait for the user to write something in a text line, provided he has not pressed a button before. Note that a fallback reaction should be added in cases like this one.</para> @@ -216,14 +217,22 @@ <para>When you want to choose an object from the target application a list with all the objects accessible by &ktutorial-editor; in the target application is shown. The name and class of each object is shown in their entry of the list. The list is an hierarchical structure, thus the parent-child relationship between objects is also shown.</para> <para>The list is updated when there are changes in the target application. For example, if a new dialog is shown in the target application, the dialog and all its children will be shown in the list.</para> <para>Usually, the objects used in tutorials are widgets, so when a widget is selected in the list it is highlighted in the target application. Plain objects obviously are not, as they do not have a graphical representation.</para> + <para>As widgets are the most used objects in tutorials, plain objects can be filtered from the list. In the same way, objects without name can also be filtered. However, some objects may appear in the list even if they should be hidden when they have any descendant that passes the enabled filters.</para> <para>When the list with the objects is shown, the rest of the &ktutorial-editor; windows are hidden. It is made to better view the widgets when they are highlighted in the target application. The &ktutorial-editor; windows are shown again once the selection list is closed.</para> + <tip> + <title>Objects with duplicated names</title> + <para>Usually, the name of an object in the target application will identify that and only that object. However, sometimes there could be two or more objects with the same name. For example, if there are two or more dialogs opened, there will probably be two or more objects named <literal>Ok button</literal>.</para> + <para>Therefore, when two or more objects have the same name, they can not be identified by their name alone. Instead, their name must be qualified with the name of one or more ancestor objects. For example, <literal>Configuration dialog/Ok button</literal>. When an object is chosen in the list, &ktutorial-editor; takes care of all this and gets a unique name for the object.</para> + <para>But note that a name and the object it represents depends on the state of the target application. For example, if there is a dialog named <literal>Configuration dialog</literal> with a button named <literal>Ok button</literal>, its unique name could be just <literal>Ok button</literal>. However, if another dialog named <literal>File information dialog</literal> were opened while the <literal>Configuration dialog</literal> was still opened, and <literal>File information dialog</literal> had a also button called <literal>Ok button</literal>, now the unique name of the first button would be <literal>Configuration dialog/Ok button</literal>. In this situation, <literal>Ok button</literal> would not represent a specific object in the target application.</para> + <para>All that means that, when choosing an object from the target application, the target application should be in the same state as it would be when following the tutorial and getting to the current step.</para> + </tip> </sect2> <sect2 id="target-application-tutorial-testing"> <title>Testing a tutorial in the target application</title> <para>Designing a tutorial is not a failproof task. Maybe your custom code does not work as expected, or you are not waiting for the right signal to be emitted, or you forgot some step, or... so the tutorial will have to be tested at least once, but more likely several times.</para> - <para>Exporting the tutorial to the application data directory and then starting the target application each time you want to test the tutorial can be very tedious. To ease testing the tutorial, &ktutorial-editor; is able to start the tutorial being designed directly in the target application.</para> + <para>Exporting the tutorial to the application data directory and then starting the target application each time you want to test the tutorial can be very tedious. To ease testing the tutorial, &ktutorial-editor; is able to start the tutorial being designed directly in the target application. The tutorial can be started from the beginning or from the currently selected step.</para> <para>Note, however, that after closing the tutorial the target application will know nothing about it. You will have to use the test action in &ktutorial-editor; to start it again, or <link linkend="export-tutorial">export</link> it to a directory known by KTutorial if you want to start it from the application itself.</para> </sect2> @@ -232,7 +241,8 @@ <para>Besides those already mentioned, &ktutorial-editor; uses a running target application to provide other small yet useful features.</para> <para>The one-line text editors to set the name of an object have text completion, so if instead of choosing the object its name is written directly in the text editor it will suggest the name based on the objects in the target application.</para> - <para>The one-line text editor to set the name of a signal also has text completion, so when the object name was set, the text editor will suggest the signal name based on the signals that can be emitted by that object.</para> + <para>The one-line text editor to set the name of a signal also has text completion, so when the object name was set, the text editor will suggest the signal name based on the signals that can be emitted by that object. The same schema is used for the name of properties.</para> + <para>The one-line text editors for step ids in the step data and reaction dialogs have text completion too. The first one will suggest the ids not assigned yet (from the <emphasis>change to step</emphasis> field of the reactions), and the second one will suggest the ids already set in the steps.</para> <para>The text completion uses the standard KDE text completion system, so all the standard keyboard shortcuts can be used (like <keycombo action="simul">&Ctrl;<keycap>T</keycap></keycombo> to show all the available completions).</para> <screenshot> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-06-17 01:47:01
|
Revision: 326 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=326&view=rev Author: danxuliu Date: 2011-06-17 01:46:54 +0000 (Fri, 17 Jun 2011) Log Message: ----------- Fix build order: the library must be built before the editor. Modified Paths: -------------- trunk/ktutorial/CMakeLists.txt Modified: trunk/ktutorial/CMakeLists.txt =================================================================== --- trunk/ktutorial/CMakeLists.txt 2011-06-13 19:49:21 UTC (rev 325) +++ trunk/ktutorial/CMakeLists.txt 2011-06-17 01:46:54 UTC (rev 326) @@ -4,6 +4,6 @@ enable_testing() +macro_optional_add_subdirectory(ktutorial-library) macro_optional_add_subdirectory(ktutorial-editor) -macro_optional_add_subdirectory(ktutorial-library) macro_optional_add_subdirectory(ktutorial-test-app) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-06-13 19:49:27
|
Revision: 325 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=325&view=rev Author: danxuliu Date: 2011-06-13 19:49:21 +0000 (Mon, 13 Jun 2011) Log Message: ----------- Fix missed internationalization in options when exported to Javascript. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/serialization/JavascriptExporter.cpp trunk/ktutorial/ktutorial-editor/src/serialization/JavascriptExporter.h trunk/ktutorial/ktutorial-editor/tests/unit/serialization/JavascriptExporterTest.cpp Modified: trunk/ktutorial/ktutorial-editor/src/serialization/JavascriptExporter.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/serialization/JavascriptExporter.cpp 2011-06-12 15:29:27 UTC (rev 324) +++ trunk/ktutorial/ktutorial-editor/src/serialization/JavascriptExporter.cpp 2011-06-13 19:49:21 UTC (rev 325) @@ -226,19 +226,19 @@ if (reaction->triggerType() == Reaction::OptionSelected && reaction->responseType() == Reaction::NextStep) { - out() << "step.addOption(ktutorial.newOption(\"" - << escape(reaction->optionName()) << "\"), \"" + QString variable = writeOption(reaction->optionName()); + out() << "step.addOption(" << variable << ", \"" << escape(reaction->nextStepId()) << "\");\n"; return; } if (reaction->triggerType() == Reaction::OptionSelected && reaction->responseType() == Reaction::CustomCode) { + QString variable = writeOption(reaction->optionName()); QString functionName = toLowerCamelCase(step->id()) + "Step" + toUpperCamelCase(reaction->optionName()) + "OptionSelected"; - out() << "step.addOption(ktutorial.newOption(\"" - << escape(reaction->optionName()) << "\"), self, \"" + out() << "step.addOption(" << variable << ", self, \"" << functionName << "()\");\n"; addFunction(functionName, reaction->customCode()); return; @@ -262,6 +262,19 @@ addFunction(functionName, reaction->customCode()); } +QString JavascriptExporter::writeOption(const QString& optionName) { + Q_ASSERT(!optionName.isEmpty()); + + QString variable = toLowerCamelCase(optionName) + "Option"; + variable = addVariable(variable); + + out() << variable << " = ktutorial.newOption(t.i18nc(" + << "\"@action Tutorial option\", \"" << escape(optionName) + << "\"));\n"; + + return variable; +} + QString JavascriptExporter::writeWaitFor(const WaitFor* waitFor) { if (qobject_cast<const WaitForComposed*>(waitFor)) { return writeWaitFor(static_cast<const WaitForComposed*>(waitFor)); Modified: trunk/ktutorial/ktutorial-editor/src/serialization/JavascriptExporter.h =================================================================== --- trunk/ktutorial/ktutorial-editor/src/serialization/JavascriptExporter.h 2011-06-12 15:29:27 UTC (rev 324) +++ trunk/ktutorial/ktutorial-editor/src/serialization/JavascriptExporter.h 2011-06-13 19:49:21 UTC (rev 325) @@ -170,6 +170,15 @@ void writeReaction(const Step* step, const Reaction* reaction); /** + * Writes the code to create and set an option. + * The option name can not be empty. + * + * @param optionName The name of the option. + * @return The name of the variable that holds the option. + */ + QString writeOption(const QString& optionName); + + /** * Writes the code to create and set a WaitFor. * * @param waitFor The WaitFor. Modified: trunk/ktutorial/ktutorial-editor/tests/unit/serialization/JavascriptExporterTest.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/tests/unit/serialization/JavascriptExporterTest.cpp 2011-06-12 15:29:27 UTC (rev 324) +++ trunk/ktutorial/ktutorial-editor/tests/unit/serialization/JavascriptExporterTest.cpp 2011-06-13 19:49:21 UTC (rev 325) @@ -431,8 +431,9 @@ TUTORIAL_EMPTY_INFORMATION_CODE STEP_WITH_ID_THE_ID_AND_EMPTY_TEXT_START_CODE "function theIdStepSetup(step) {\n" -" step.addOption(ktutorial.newOption(\"The option name\"), \ -\"Another step\");\n" +" theOptionNameOption = ktutorial.newOption(\ +t.i18nc(\"@action Tutorial option\", \"The option name\"));\n" +" step.addOption(theOptionNameOption, \"Another step\");\n" "\n" " The custom setup\n" " code\n" @@ -536,7 +537,9 @@ " step.addWaitFor(waitForTheSignalNameByTheEmitterName, self, \ \"theIdStepWaitForTheSignalNameByTheEmitterNameConditionMet()\");\n" "\n" -" step.addOption(ktutorial.newOption(\"The option name\"), self, \ +" theOptionNameOption = ktutorial.newOption(\ +t.i18nc(\"@action Tutorial option\", \"The option name\"));\n" +" step.addOption(theOptionNameOption, self, \ \"theIdStepTheOptionNameOptionSelected()\");\n" "}\n" CONNECT_STEP_SETUP @@ -575,8 +578,9 @@ TUTORIAL_EMPTY_INFORMATION_CODE STEP_WITH_ID_THE_ID_AND_EMPTY_TEXT_START_CODE "function theIdStepSetup(step) {\n" -" step.addOption(ktutorial.newOption(\"The option name\"), \ -\"Another step\");\n" +" theOptionNameOption = ktutorial.newOption(\ +t.i18nc(\"@action Tutorial option\", \"The option name\"));\n" +" step.addOption(theOptionNameOption, \"Another step\");\n" "}\n" CONNECT_STEP_SETUP STEP_WITH_ID_THE_ID_AND_EMPTY_TEXT_END_CODE; @@ -604,8 +608,9 @@ TUTORIAL_EMPTY_INFORMATION_CODE STEP_WITH_ID_THE_ID_AND_EMPTY_TEXT_START_CODE "function theIdStepSetup(step) {\n" -" step.addOption(ktutorial.newOption(\"The \\\"option\\\" name\"), \ -\"Another \\\"step\\\"\");\n" +" theOptionNameOption = ktutorial.newOption(\ +t.i18nc(\"@action Tutorial option\", \"The \\\"option\\\" name\"));\n" +" step.addOption(theOptionNameOption, \"Another \\\"step\\\"\");\n" "}\n" CONNECT_STEP_SETUP STEP_WITH_ID_THE_ID_AND_EMPTY_TEXT_END_CODE; @@ -675,7 +680,9 @@ TUTORIAL_EMPTY_INFORMATION_CODE STEP_WITH_ID_THE_ID_AND_EMPTY_TEXT_START_CODE "function theIdStepSetup(step) {\n" -" step.addOption(ktutorial.newOption(\"The option name\"), self, \ +" theOptionNameOption = ktutorial.newOption(\ +t.i18nc(\"@action Tutorial option\", \"The option name\"));\n" +" step.addOption(theOptionNameOption, self, \ \"theIdStepTheOptionNameOptionSelected()\");\n" "}\n" CONNECT_STEP_SETUP @@ -709,7 +716,9 @@ TUTORIAL_EMPTY_INFORMATION_CODE STEP_WITH_ID_THE_ID_AND_EMPTY_TEXT_START_CODE "function theIdStepSetup(step) {\n" -" step.addOption(ktutorial.newOption(\"The \\\"option\\\" name\"), self, \ +" theOptionNameOption = ktutorial.newOption(\ +t.i18nc(\"@action Tutorial option\", \"The \\\"option\\\" name\"));\n" +" step.addOption(theOptionNameOption, self, \ \"theIdStepTheOptionNameOptionSelected()\");\n" "}\n" CONNECT_STEP_SETUP @@ -757,7 +766,9 @@ TUTORIAL_EMPTY_INFORMATION_CODE STEP_WITH_ID_THE_ID_AND_EMPTY_TEXT_START_CODE "function theIdStepSetup(step) {\n" -" step.addOption(ktutorial.newOption(\"The option name\"), self, \ +" theOptionNameOption = ktutorial.newOption(\ +t.i18nc(\"@action Tutorial option\", \"The option name\"));\n" +" step.addOption(theOptionNameOption, self, \ \"theIdStepTheOptionNameOptionSelected()\");\n" "}\n" CONNECT_STEP_SETUP This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-06-12 15:29:33
|
Revision: 324 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=324&view=rev Author: danxuliu Date: 2011-06-12 15:29:27 +0000 (Sun, 12 Jun 2011) Log Message: ----------- Change TargetApplication signals behaviour. Now, finished() signal is only emitted if started() was previously emitted, and startFailed(Error) is now emitted whenever the target application ends before being able to determine if it uses KTutorial or not. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.h trunk/ktutorial/ktutorial-editor/src/view/TargetApplicationView.cpp trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/TargetApplicationTest.cpp Modified: trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp 2011-06-10 22:19:57 UTC (rev 323) +++ trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp 2011-06-12 15:29:27 UTC (rev 324) @@ -202,11 +202,16 @@ } mProcess->kill(); - - emit startFailed(InvalidApplication); } void TargetApplication::clean() { + bool wasStartedSuccessfully = true; + if (!mRemoteEditorSupport) { + wasStartedSuccessfully = false; + + emit startFailed(InvalidApplication); + } + //Don't delete it directly, as waitForFinished crashes somewhere internally //due to an event problem mProcess->deleteLater(); @@ -216,5 +221,7 @@ delete mMapper; mMapper = 0; - emit finished(); + if (wasStartedSuccessfully) { + emit finished(); + } } Modified: trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.h =================================================================== --- trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.h 2011-06-10 22:19:57 UTC (rev 323) +++ trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.h 2011-06-12 15:29:27 UTC (rev 324) @@ -42,13 +42,13 @@ * * The TargetApplication can be started using method start(). The method returns * immediately, and when the application is really running the started() signal - * is emitted. If the application could not be executed, or it was executed but - * other problem happened (for example, if the target application does not - * support KTutorial), startFailed(Error) signal is emitted instead. + * is emitted (if it uses KTutorial). If the application could not be executed, + * or it was executed but other problem happened (for example, if the target + * application does not use KTutorial), startFailed(Error) signal is emitted + * instead. * - * Note that started() and startFailed(Error) signals may not be emitted if the - * target application is closed too soon to realize that it was successfully - * started or that it does not support KTutorial. + * Note that startFailed(Error) signal is also emitted if the target application + * is closed too soon to check if it uses KTutorial. * * Once the target application has been started, remoteEditorSupport * returns a RemoteEditorSupport connected to the remote @@ -58,7 +58,8 @@ * The target application will be killed when the TargetApplication is * destroyed, or when the start method is called again after setting a different * application file path. In any of those cases, or if the target application - * was closed externally (by the user), finished() signal is emitted. + * was closed externally (by the user), finished() signal is emitted (but only + * if, preiously, it was successfully started). */ class TargetApplication: public QObject { Q_OBJECT @@ -70,7 +71,7 @@ enum Error { /** - * The application was started, but it does not support KTutorial. + * The application was started, but it does not use KTutorial. */ InvalidApplication, @@ -128,8 +129,9 @@ * Starts a new TargetApplication. * When the target application is running, started() signal is emitted. If * there is no application file path, the application file path is not valid - * or the application does not support KTutorial editor, startFailed(Error) - * signal is emitted instead. + * or the application does not support KTutorial editor (or it was closed + * before being able to determine it), startFailed(Error) signal is emitted + * instead. * * If the target application was already started nothing is done (even * started() signal is not emitted). @@ -139,8 +141,8 @@ Q_SIGNALS: /** - * Emitted when the target application was started and there is a D-Bus - * connection to it. + * Emitted when the target application was started, it uses KTutorial and + * there is a D-Bus connection to it. */ void started(); @@ -152,7 +154,10 @@ void startFailed(TargetApplication::Error error); /** - * Emitted when the target application was finished for any reason. + * Emitted when the target application was finished after being successfully + * started. + * Note that this signal is not emitted, for example, when a target + * application without support for KTutorial is closed. */ void finished(); @@ -177,7 +182,7 @@ * Timer to give time to "/ktutorial" object to appear in the service of * the target application. * If the timer ends and the object was not found, the target application - * seems to not to support KTutorial editor. + * seems to not to use KTutorial editor. */ QTimer mKTutorialSupportModuleDiscoveryTimer; @@ -234,15 +239,16 @@ /** * Called when the time to find the "/ktutorial" object expired. - * Signal startFailed(Error), with InvalidApplication, is emitted in that - * case. + * The target application is killed (which causes signal startFailed(Error), + * with InvalidApplication, to be emitted). */ void handleTargetApplicationDoesNotSupportKTutorial(); /** * Called when the process has finished. - * The process, mapper and remote editor support are deleted, and the - * finished() signal is emitted. + * The process, mapper and remote editor support are deleted. + * startFailed(Error) and finished() signals are emitted, depending on the + * case. */ void clean(); Modified: trunk/ktutorial/ktutorial-editor/src/view/TargetApplicationView.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/TargetApplicationView.cpp 2011-06-10 22:19:57 UTC (rev 323) +++ trunk/ktutorial/ktutorial-editor/src/view/TargetApplicationView.cpp 2011-06-12 15:29:27 UTC (rev 324) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -84,15 +84,10 @@ //to show the error message. However, once started the signal must be //disconnected to avoid showing several error messages (for example, if the //target application fails after being started several times by this view). - //finished() is also connected, as if the target application is closed - //before it could be checked whether it supports KTutorial or not, only - //finished() signal is emitted. connect(mTargetApplication, SIGNAL(started()), this, SLOT(stopExpectingTheTargetApplicationToStart())); connect(mTargetApplication, SIGNAL(startFailed(TargetApplication::Error)), this, SLOT(showErrorMessage(TargetApplication::Error))); - connect(mTargetApplication, SIGNAL(finished()), - this, SLOT(stopExpectingTheTargetApplicationToStart())); QApplication::setOverrideCursor(QCursor(Qt::BusyCursor)); } @@ -129,8 +124,6 @@ this, SLOT(stopExpectingTheTargetApplicationToStart())); disconnect(mTargetApplication, SIGNAL(startFailed(TargetApplication::Error)), this, SLOT(showErrorMessage(TargetApplication::Error))); - disconnect(mTargetApplication, SIGNAL(finished()), - this, SLOT(stopExpectingTheTargetApplicationToStart())); QApplication::restoreOverrideCursor(); } Modified: trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/TargetApplicationTest.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/TargetApplicationTest.cpp 2011-06-10 22:19:57 UTC (rev 323) +++ trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/TargetApplicationTest.cpp 2011-06-12 15:29:27 UTC (rev 324) @@ -406,13 +406,13 @@ TargetApplication targetApplication; targetApplication.setTargetApplicationFilePath(mTargetApplicationStubPath); - QSignalSpy startedSpy(&targetApplication, SIGNAL(started())); //TargetApplication::Error must be registered in order to be used with //QSignalSpy qRegisterMetaType<TargetApplication::Error>("TargetApplication::Error"); - QSignalSpy startFailedSpy(&targetApplication, - SIGNAL(startFailed(TargetApplication::Error))); - SignalWait finishedWait(&targetApplication, SIGNAL(finished())); + SignalWait startFailedWait(&targetApplication, + SIGNAL(startFailed(TargetApplication::Error))); + QSignalSpy startedSpy(&targetApplication, SIGNAL(started())); + QSignalSpy finishedSpy(&targetApplication, SIGNAL(finished())); targetApplication.start(); @@ -422,7 +422,10 @@ targetApplication.mProcess->kill(); - QVERIFY(finishedWait.waitForCount(1, 1000)); + QVERIFY(startFailedWait.waitForCount(1, 1000)); + QVariant argument = startFailedWait.spy().at(0).at(0); + QCOMPARE(qvariant_cast<TargetApplication::Error>(argument), + TargetApplication::InvalidApplication); QVERIFY(!targetApplication.remoteEditorSupport()); //Keep waiting until the timeout expires to ensure that no other signal is @@ -430,7 +433,8 @@ QTest::qWait(3000); QCOMPARE(startedSpy.count(), 0); - QCOMPARE(startFailedSpy.count(), 0); + QCOMPARE(startFailedWait.spy().count(), 1); + QCOMPARE(finishedSpy.count(), 0); } void TargetApplicationTest:: @@ -439,13 +443,13 @@ targetApplication.setTargetApplicationFilePath( QApplication::applicationDirPath() + "/DummyApplication"); - QSignalSpy startedSpy(&targetApplication, SIGNAL(started())); //TargetApplication::Error must be registered in order to be used with //QSignalSpy qRegisterMetaType<TargetApplication::Error>("TargetApplication::Error"); - QSignalSpy startFailedSpy(&targetApplication, - SIGNAL(startFailed(TargetApplication::Error))); - SignalWait finishedWait(&targetApplication, SIGNAL(finished())); + SignalWait startFailedWait(&targetApplication, + SIGNAL(startFailed(TargetApplication::Error))); + QSignalSpy startedSpy(&targetApplication, SIGNAL(started())); + QSignalSpy finishedSpy(&targetApplication, SIGNAL(finished())); targetApplication.start(); @@ -455,7 +459,10 @@ targetApplication.mProcess->kill(); - QVERIFY(finishedWait.waitForCount(1, 1000)); + QVERIFY(startFailedWait.waitForCount(1, 1000)); + QVariant argument = startFailedWait.spy().at(0).at(0); + QCOMPARE(qvariant_cast<TargetApplication::Error>(argument), + TargetApplication::InvalidApplication); QVERIFY(!targetApplication.remoteEditorSupport()); //Keep waiting until the timeout expires to ensure that no other signal is @@ -463,7 +470,8 @@ QTest::qWait(3000); QCOMPARE(startedSpy.count(), 0); - QCOMPARE(startFailedSpy.count(), 0); + QCOMPARE(startFailedWait.spy().count(), 1); + QCOMPARE(finishedSpy.count(), 0); } QTEST_MAIN(TargetApplicationTest) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-06-10 22:20:03
|
Revision: 323 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=323&view=rev Author: danxuliu Date: 2011-06-10 22:19:57 +0000 (Fri, 10 Jun 2011) Log Message: ----------- Delete the KProcess object when the target application failed to start. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp Modified: trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp 2011-06-10 18:01:50 UTC (rev 322) +++ trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp 2011-06-10 22:19:57 UTC (rev 323) @@ -188,6 +188,9 @@ mKTutorialSupportModuleDiscoveryTimer.stop(); + mProcess->deleteLater(); + mProcess = 0; + emit startFailed(InvalidPath); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-06-10 18:01:57
|
Revision: 322 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=322&view=rev Author: danxuliu Date: 2011-06-10 18:01:50 +0000 (Fri, 10 Jun 2011) Log Message: ----------- Fix making unnecessary service checks when there is no target application running. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp Modified: trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp 2011-06-10 16:33:31 UTC (rev 321) +++ trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp 2011-06-10 18:01:50 UTC (rev 322) @@ -119,6 +119,15 @@ //private slots: void TargetApplication::checkNewService(const QString& service) { + //Do not check new services if there is no target application running. The + //slot may still be connected if no service was found for the target + //application (for example, if it failed to start, if it did not use D-Bus, + //if it was closed before checking the service...) + if (!mProcess) { + disconnect(QDBusConnection::sessionBus().interface(), 0, this, 0); + return; + } + QDBusInterface mainDBusInterface("org.freedesktop.DBus", "/", "org.freedesktop.DBus"); if (!mainDBusInterface.isValid()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-06-10 16:33:38
|
Revision: 321 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=321&view=rev Author: danxuliu Date: 2011-06-10 16:33:31 +0000 (Fri, 10 Jun 2011) Log Message: ----------- Fix making unnecessary connections to the time out signal every time a target application is started. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp Modified: trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp 2011-06-10 16:17:10 UTC (rev 320) +++ trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp 2011-06-10 16:33:31 UTC (rev 321) @@ -99,8 +99,6 @@ mKTutorialSupportModuleDiscoveryTimer.setSingleShot(true); connect(mProcess, SIGNAL(started()), &mKTutorialSupportModuleDiscoveryTimer, SLOT(start())); - connect(&mKTutorialSupportModuleDiscoveryTimer, SIGNAL(timeout()), - this, SLOT(handleTargetApplicationDoesNotSupportKTutorial())); mProcess->start(); } @@ -113,6 +111,9 @@ mProcess(0), mMapper(0), mRemoteEditorSupport(0) { + + connect(&mKTutorialSupportModuleDiscoveryTimer, SIGNAL(timeout()), + this, SLOT(handleTargetApplicationDoesNotSupportKTutorial())); } //private slots: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-06-10 16:17:17
|
Revision: 320 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=320&view=rev Author: danxuliu Date: 2011-06-10 16:17:10 +0000 (Fri, 10 Jun 2011) Log Message: ----------- Change how the target application is detected. Before, every D-Bus service that appeared in the bus was queried for the applicationFilePath in its ktutorial object. However, an application can provide a D-Bus service before the ktutorial object is registered in it, so a valid application could be seen as invalid just because the KTutorial module was not registered yet. Now, the service of the target application is found using the PID of its process, and if the ktutorial object is not registered yet, the service is queried again until the object is found (or the timer to find the application times out). Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.h trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/CMakeLists.txt trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/TargetApplicationTest.cpp Added Paths: ----------- trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/TargetApplicationStubWithDelayedRegister.cpp Modified: trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp 2011-06-08 14:49:14 UTC (rev 319) +++ trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.cpp 2011-06-10 16:17:10 UTC (rev 320) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -95,11 +95,11 @@ connect(mProcess, SIGNAL(finished(int)), this, SLOT(clean())); - mServiceDiscoveryTimer.setInterval(3000); - mServiceDiscoveryTimer.setSingleShot(true); + mKTutorialSupportModuleDiscoveryTimer.setInterval(3000); + mKTutorialSupportModuleDiscoveryTimer.setSingleShot(true); connect(mProcess, SIGNAL(started()), - &mServiceDiscoveryTimer, SLOT(start())); - connect(&mServiceDiscoveryTimer, SIGNAL(timeout()), + &mKTutorialSupportModuleDiscoveryTimer, SLOT(start())); + connect(&mKTutorialSupportModuleDiscoveryTimer, SIGNAL(timeout()), this, SLOT(handleTargetApplicationDoesNotSupportKTutorial())); mProcess->start(); @@ -118,33 +118,53 @@ //private slots: void TargetApplication::checkNewService(const QString& service) { - QDBusInterface interface(service, "/ktutorial", - "org.kde.ktutorial.EditorSupport"); - if (!interface.isValid()) { + QDBusInterface mainDBusInterface("org.freedesktop.DBus", "/", + "org.freedesktop.DBus"); + if (!mainDBusInterface.isValid()) { return; } - QDBusReply<QString> reply = interface.call("applicationFilePath"); - if (!reply.isValid()) { + QDBusReply<uint> pidReply = + mainDBusInterface.call("GetConnectionUnixProcessID", service); + if (!pidReply.isValid()) { return; } - if (reply.value() != mTargetApplicationFilePath) { + if (pidReply.value() != (uint)mProcess->pid()) { return; } - mServiceDiscoveryTimer.stop(); - - //The bus must be disconnected before executing other code to ensure that - //no other services are handled, as when an application starts it can create - //more than one valid service: one like ":1.42" and another like - //"org.freedesktop.DBus". - //So this method could be called again before finishing its current - //execution if serviceRegistered(QSignal) is emitted, which could happen if - //other event loops are created (like in a message box). disconnect(QDBusConnection::sessionBus().interface(), 0, this, 0); mServiceName = service; + + checkKTutorialSupportModule(); +} + +void TargetApplication::checkKTutorialSupportModule() { + //Prevent pending checks from being executed after the timeout of the + //discovery timer + if (!mKTutorialSupportModuleDiscoveryTimer.isActive()) { + return; + } + + QDBusInterface interface(mServiceName, "/ktutorial", + "org.freedesktop.DBus.Introspectable"); + if (!interface.isValid()) { + QTimer::singleShot(500, this, SLOT(checkKTutorialSupportModule())); + return; + } + + //Just a generic DBus call to check whether /ktutorial is already available + //or not + QDBusReply<QString> reply = interface.call("Introspect"); + if (!reply.isValid()) { + QTimer::singleShot(500, this, SLOT(checkKTutorialSupportModule())); + return; + } + + mKTutorialSupportModuleDiscoveryTimer.stop(); + mMapper = new RemoteObjectMapper(mServiceName); mRemoteEditorSupport = new RemoteEditorSupport(mServiceName, mMapper); @@ -156,7 +176,7 @@ return; } - mServiceDiscoveryTimer.stop(); + mKTutorialSupportModuleDiscoveryTimer.stop(); emit startFailed(InvalidPath); } Modified: trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.h =================================================================== --- trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.h 2011-06-08 14:49:14 UTC (rev 319) +++ trunk/ktutorial/ktutorial-editor/src/targetapplication/TargetApplication.h 2011-06-10 16:17:10 UTC (rev 320) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -174,12 +174,12 @@ KProcess* mProcess; /** - * Timer to give time to "/ktutorial" object to appear in some new service - * of the bus. + * Timer to give time to "/ktutorial" object to appear in the service of + * the target application. * If the timer ends and the object was not found, the target application * seems to not to support KTutorial editor. */ - QTimer mServiceDiscoveryTimer; + QTimer mKTutorialSupportModuleDiscoveryTimer; /** * The D-Bus service name provided by the target application, if any. @@ -208,14 +208,23 @@ /** * Checks if the new service found in the session bus is the one from the * started target application. - * When the service is found, the target application has started from - * KTutorial editor point of view. Signal started() is emitted in that case. + * If the service is provided by the target application, it is checked if it + * contains the support module from KTutorial. * * @param service The D-Bus service to check. */ void checkNewService(const QString& service); /** + * Checks if the service of the target application provides the "/ktutorial" + * object. + * If the object is not found, the service will be checked again later. + * When the object is found, the target application has started from + * KTutorial editor point of view. Signal started() is emitted in that case. + */ + void checkKTutorialSupportModule(); + + /** * Checks if the process could not be started. * Signal startFailed(Error), with InvalidPath, is emitted in that case. * @@ -224,7 +233,7 @@ void handleProcessError(QProcess::ProcessError error); /** - * Called when the time out to find the D-Bus service expired. + * Called when the time to find the "/ktutorial" object expired. * Signal startFailed(Error), with InvalidApplication, is emitted in that * case. */ Modified: trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/CMakeLists.txt =================================================================== --- trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/CMakeLists.txt 2011-06-08 14:49:14 UTC (rev 319) +++ trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/CMakeLists.txt 2011-06-10 16:17:10 UTC (rev 320) @@ -14,6 +14,12 @@ add_executable(TargetApplicationStub TargetApplicationStub.cpp ${dbus_interface_stubs_MOC}) target_link_libraries(TargetApplicationStub ${KDE4_KDEUI_LIBS} ${QT_QTDBUS_LIBRARY}) +# Target application stub with delayed register to be executed in TargetApplication test +set(TargetApplicationStubWithDelayedRegister_MOC ${CMAKE_CURRENT_BINARY_DIR}/TargetApplicationStubWithDelayedRegister.moc) +qt4_generate_moc(TargetApplicationStubWithDelayedRegister.cpp ${TargetApplicationStubWithDelayedRegister_MOC}) +add_executable(TargetApplicationStubWithDelayedRegister TargetApplicationStubWithDelayedRegister.cpp ${TargetApplicationStubWithDelayedRegister_MOC} ${dbus_interface_stubs_MOC}) +target_link_libraries(TargetApplicationStubWithDelayedRegister ${KDE4_KDEUI_LIBS} ${QT_QTDBUS_LIBRARY}) + MACRO(UNIT_TESTS) FOREACH(_className ${ARGN}) set(_testName ${_className}Test) Added: trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/TargetApplicationStubWithDelayedRegister.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/TargetApplicationStubWithDelayedRegister.cpp (rev 0) +++ trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/TargetApplicationStubWithDelayedRegister.cpp 2011-06-10 16:17:10 UTC (rev 320) @@ -0,0 +1,60 @@ +/*************************************************************************** + * Copyright (C) 2011 by Daniel Calviño Sánchez * + * dan...@gm... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; If not, see <http://www.gnu.org/licenses/>. * + ***************************************************************************/ + +#include <KApplication> +#include <KCmdLineArgs> +#include <KMainWindow> + +#include "RemoteClassStubs.h" + +class MainWindow: public KMainWindow { +Q_OBJECT +public: + + MainWindow() { + QTimer::singleShot(1000, this, SLOT(registerKTutorialInDBus())); + } + +private slots: + + void registerKTutorialInDBus() { + StubEditorSupport* editorSupport = new StubEditorSupport(); + QDBusConnection::sessionBus().registerObject("/ktutorial", + editorSupport, QDBusConnection::ExportAllSlots); + + StubObjectRegister* objectRegister = new StubObjectRegister(); + QDBusConnection::sessionBus().registerObject( + "/ktutorial/ObjectRegister", objectRegister, + QDBusConnection::ExportAdaptors); + } + +}; + +int main (int argc, char *argv[]) { + KCmdLineArgs::init(argc, argv, "TargetApplicationStubWithDelayedRegister", + "", ki18n(""), ""); + + KApplication app; + + KMainWindow* window = new MainWindow(); + window->show(); + + return app.exec(); +} + +#include "TargetApplicationStubWithDelayedRegister.moc" Property changes on: trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/TargetApplicationStubWithDelayedRegister.cpp ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/TargetApplicationTest.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/TargetApplicationTest.cpp 2011-06-08 14:49:14 UTC (rev 319) +++ trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/TargetApplicationTest.cpp 2011-06-10 16:17:10 UTC (rev 320) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -59,6 +59,7 @@ void testSetTargetApplicationFilePathRelative(); void testStart(); + void testStartApplicationWithDelayedRegister(); void testStartAlreadyStarted(); void testStartAfterSettingAgainTargetApplicationFilePath(); void testStartAfterChangingTargetApplicationFilePath(); @@ -203,6 +204,21 @@ QString("The object name 42")); } +void TargetApplicationTest::testStartApplicationWithDelayedRegister() { + TargetApplication targetApplication; + targetApplication.setTargetApplicationFilePath( + QApplication::applicationDirPath() + + "/TargetApplicationStubWithDelayedRegister"); + + SignalWait startedWait(&targetApplication, SIGNAL(started())); + targetApplication.start(); + + QVERIFY(startedWait.waitForCount(1, 2000)); + QVERIFY(targetApplication.remoteEditorSupport()); + QCOMPARE(targetApplication.remoteEditorSupport()->mainWindow()->name(), + QString("The object name 42")); +} + void TargetApplicationTest::testStartAlreadyStarted() { TargetApplication targetApplication; targetApplication.setTargetApplicationFilePath(mTargetApplicationStubPath); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-06-08 14:49:19
|
Revision: 319 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=319&view=rev Author: danxuliu Date: 2011-06-08 14:49:14 +0000 (Wed, 08 Jun 2011) Log Message: ----------- Enable word wrap in the tutorial tree view. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.cpp Modified: trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.cpp 2011-06-08 14:44:12 UTC (rev 318) +++ trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.cpp 2011-06-08 14:49:14 UTC (rev 319) @@ -49,6 +49,7 @@ mTreeView = new AutoExpandableTreeView(); mTreeView->setObjectName("centralTreeView"); + mTreeView->setWordWrap(true); setCentralWidget(mTreeView); setupDocks(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-06-08 14:44:18
|
Revision: 318 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=318&view=rev Author: danxuliu Date: 2011-06-08 14:44:12 +0000 (Wed, 08 Jun 2011) Log Message: ----------- Fix missing i18n call. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/view/ReactionTreeItem.cpp Modified: trunk/ktutorial/ktutorial-editor/src/view/ReactionTreeItem.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/ReactionTreeItem.cpp 2011-06-08 12:48:46 UTC (rev 317) +++ trunk/ktutorial/ktutorial-editor/src/view/ReactionTreeItem.cpp 2011-06-08 14:44:12 UTC (rev 318) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -116,7 +116,7 @@ } if (reaction->customCode().isEmpty()) { - mResponseCustomCodeItem->setText("(No code set)"); + mResponseCustomCodeItem->setText(i18nc("@item", "(No code set)")); } else { mResponseCustomCodeItem->setText(reaction->customCode()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-06-08 13:23:46
|
Revision: 317 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=317&view=rev Author: danxuliu Date: 2011-06-08 12:48:46 +0000 (Wed, 08 Jun 2011) Log Message: ----------- Add support for testing a tutorial from the currently selected step instead of just from the start. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/CMakeLists.txt trunk/ktutorial/ktutorial-editor/src/EditActions.cpp trunk/ktutorial/ktutorial-editor/src/EditActions.h trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.cpp trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.h trunk/ktutorial/ktutorial-editor/src/TutorialTester.cpp trunk/ktutorial/ktutorial-editor/src/TutorialTester.h trunk/ktutorial/ktutorial-editor/src/ktutorial-editorui.rc trunk/ktutorial/ktutorial-editor/src/targetapplication/RemoteEditorSupport.cpp trunk/ktutorial/ktutorial-editor/src/targetapplication/RemoteEditorSupport.h trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/RemoteClassStubs.h trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/RemoteEditorSupportTest.cpp Added Paths: ----------- trunk/ktutorial/ktutorial-editor/src/TestTutorialActions.cpp trunk/ktutorial/ktutorial-editor/src/TestTutorialActions.h Modified: trunk/ktutorial/ktutorial-editor/src/CMakeLists.txt =================================================================== --- trunk/ktutorial/ktutorial-editor/src/CMakeLists.txt 2011-06-08 12:46:04 UTC (rev 316) +++ trunk/ktutorial/ktutorial-editor/src/CMakeLists.txt 2011-06-08 12:48:46 UTC (rev 317) @@ -41,6 +41,7 @@ if (QT_QTDBUS_FOUND) set(ktutorial_editor_SRCS ${ktutorial_editor_SRCS} + TestTutorialActions.cpp TutorialTester.cpp ) endif (QT_QTDBUS_FOUND) Modified: trunk/ktutorial/ktutorial-editor/src/EditActions.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/EditActions.cpp 2011-06-08 12:46:04 UTC (rev 316) +++ trunk/ktutorial/ktutorial-editor/src/EditActions.cpp 2011-06-08 12:48:46 UTC (rev 317) @@ -37,10 +37,6 @@ #include "view/TutorialCustomCodeWidget.h" #include "view/TutorialInformationWidget.h" -#ifdef QT_QTDBUS_FOUND -#include "TutorialTester.h" -#endif - //public: EditActions::EditActions(KTutorialEditor* tutorialEditor): @@ -211,18 +207,6 @@ action->setEnabled(false); actionCollection->addAction("removeReaction", action); connect(action, SIGNAL(triggered(bool)), this, SLOT(removeReaction())); - -#ifdef QT_QTDBUS_FOUND - action = new KAction(this); - action->setText(i18nc("@action", "Test tutorial")); - action->setStatusTip(i18nc("@info:status", "Starts the tutorial in the " -"target application.")); - action->setIcon(KIcon("document-preview")); - action->setEnabled(true); - actionCollection->addAction("testTutorial", action); - connect(action, SIGNAL(triggered(bool)), - new TutorialTester(mTutorialEditor), SLOT(testTutorial())); -#endif } int EditActions::showEditionDialog(CommandWidget* commandWidget) { Modified: trunk/ktutorial/ktutorial-editor/src/EditActions.h =================================================================== --- trunk/ktutorial/ktutorial-editor/src/EditActions.h 2011-06-08 12:46:04 UTC (rev 316) +++ trunk/ktutorial/ktutorial-editor/src/EditActions.h 2011-06-08 12:48:46 UTC (rev 317) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -30,8 +30,7 @@ /** * Edition related actions. * EditActions provide the actions to edit a tutorial (set the setup code, add a - * step...), actions to undo and redo the edition, and also an action to test - * the current tutorial in the target application. + * step...), and actions to undo and redo the edition. * * KTutorialEditor notifies EditActions when a step or reaction is selected, so * it can know which step or reaction have to be edited. EditActions provides Modified: trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.cpp 2011-06-08 12:46:04 UTC (rev 316) +++ trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.cpp 2011-06-08 12:48:46 UTC (rev 317) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -38,6 +38,7 @@ #include "view/TutorialTreeSelectionManager.h" #ifdef QT_QTDBUS_FOUND +#include "TestTutorialActions.h" #include "targetapplication/TargetApplication.h" #endif @@ -145,6 +146,10 @@ mEditActions, SLOT(selectStep(Step*))); connect(selectionManager, SIGNAL(reactionSelected(Reaction*)), mEditActions, SLOT(selectReaction(Reaction*))); +#ifdef QT_QTDBUS_FOUND + connect(selectionManager, SIGNAL(stepSelected(Step*)), + mTestTutorialActions, SLOT(selectStep(Step*))); +#endif mEditActions->clearCommands(); @@ -179,6 +184,10 @@ mEditActions = new EditActions(this); +#ifdef QT_QTDBUS_FOUND + mTestTutorialActions = new TestTutorialActions(this); +#endif + actionCollection()->addAction("showEditTutorialDock", mTutorialActionDock->toggleViewAction()); actionCollection()->addAction("showEditStepDock", Modified: trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.h =================================================================== --- trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.h 2011-06-08 12:46:04 UTC (rev 316) +++ trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.h 2011-06-08 12:48:46 UTC (rev 317) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -27,6 +27,10 @@ class QTreeView; class Tutorial; +#ifdef QT_QTDBUS_FOUND +class TestTutorialActions; +#endif + /** * KTutorial editor main window. * It wires up all the components in the application. @@ -152,7 +156,14 @@ */ EditActions* mEditActions; +#ifdef QT_QTDBUS_FOUND /** + * The test tutorial related actions and data. + */ + TestTutorialActions* mTestTutorialActions; +#endif + + /** * The tutorial being edited. */ Tutorial* mTutorial; Added: trunk/ktutorial/ktutorial-editor/src/TestTutorialActions.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/TestTutorialActions.cpp (rev 0) +++ trunk/ktutorial/ktutorial-editor/src/TestTutorialActions.cpp 2011-06-08 12:48:46 UTC (rev 317) @@ -0,0 +1,108 @@ +/*************************************************************************** + * Copyright (C) 2011 by Daniel Calviño Sánchez * + * dan...@gm... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; If not, see <http://www.gnu.org/licenses/>. * + ***************************************************************************/ + +#include "TestTutorialActions.h" + +#include <KAction> +#include <KActionCollection> +#include <KLocalizedString> + +#include "KTutorialEditor.h" +#include "TutorialTester.h" +#include "data/Step.h" + +//public: + +TestTutorialActions::TestTutorialActions(KTutorialEditor* tutorialEditor): + QObject(tutorialEditor), + mTutorialEditor(tutorialEditor), + mCurrentStep(0) { + + setupActions(); +} + +//public slots: + +void TestTutorialActions::selectStep(Step* step) { + if (mCurrentStep) { + disconnect(mCurrentStep, SIGNAL(dataChanged(Step*)), + this, SLOT(updateTestTutorialFromCurrentStepActionState())); + } + + mCurrentStep = step; + + if (mCurrentStep) { + connect(mCurrentStep, SIGNAL(dataChanged(Step*)), + this, SLOT(updateTestTutorialFromCurrentStepActionState())); + } + + updateTestTutorialFromCurrentStepActionState(); +} + +//private: + +void TestTutorialActions::setupActions() { + KActionCollection* actionCollection = mTutorialEditor->actionCollection(); + + KAction* action = new KAction(this); + action = new KAction(this); + action->setText(i18nc("@action", "Test tutorial")); + action->setStatusTip(i18nc("@info:status", "Starts the tutorial in the " +"target application.")); + action->setIcon(KIcon("document-preview")); + action->setEnabled(true); + actionCollection->addAction("testTutorial", action); + connect(action, SIGNAL(triggered(bool)), + this, SLOT(testTutorial())); + + action = new KAction(this); + action->setText(i18nc("@action", "Test tutorial from current step")); + action->setStatusTip(i18nc("@info:status", "Starts the tutorial in the " +"target application from the current step.")); + action->setIcon(KIcon("document-preview")); + action->setEnabled(false); + actionCollection->addAction("testTutorialFromCurrentStep", action); + connect(action, SIGNAL(triggered(bool)), + this, SLOT(testTutorialFromCurrentStep())); +} + +//private slots: + +void TestTutorialActions::updateTestTutorialFromCurrentStepActionState() { + KActionCollection* actionCollection = mTutorialEditor->actionCollection(); + QAction* action = actionCollection->action("testTutorialFromCurrentStep"); + + if (mCurrentStep && !mCurrentStep->id().isEmpty()) { + action->setEnabled(true); + } else { + action->setEnabled(false); + } +} + +void TestTutorialActions::testTutorial() { + TutorialTester* tutorialTester = new TutorialTester(mTutorialEditor); + tutorialTester->testTutorial(); +} + +void TestTutorialActions::testTutorialFromCurrentStep() { + Q_ASSERT(mCurrentStep); + + TutorialTester* tutorialTester = new TutorialTester(mTutorialEditor); + tutorialTester->setStepToTestFrom(mCurrentStep->id()); + tutorialTester->testTutorial(); +} Property changes on: trunk/ktutorial/ktutorial-editor/src/TestTutorialActions.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/ktutorial/ktutorial-editor/src/TestTutorialActions.h =================================================================== --- trunk/ktutorial/ktutorial-editor/src/TestTutorialActions.h (rev 0) +++ trunk/ktutorial/ktutorial-editor/src/TestTutorialActions.h 2011-06-08 12:48:46 UTC (rev 317) @@ -0,0 +1,95 @@ +/*************************************************************************** + * Copyright (C) 2011 by Daniel Calviño Sánchez * + * dan...@gm... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; If not, see <http://www.gnu.org/licenses/>. * + ***************************************************************************/ + +#ifndef TESTTUTORIALACTIONS_H +#define TESTTUTORIALACTIONS_H + +#include <QObject> + +class KTutorialEditor; +class Step; + +/** + * Test tutorial related actions. + * TestTutorialActions provide the actions to test the current tutorial in the + * target application (from the start or from the selected step). + * + * KTutorialEditor notifies TestTutorialActions when a step is selected, so it + * can know from which step test the tutorial. + */ +class TestTutorialActions: public QObject { +Q_OBJECT +public: + + /** + * Creates a new TestTutorialActions for the given KTutorialEditor. + * All the actions are set up and added to the KTutorialEditor. + * + * @param tutorialEditor The KTutorialEditor to work with. + */ + explicit TestTutorialActions(KTutorialEditor* tutorialEditor); + +public Q_SLOTS: + + /** + * Sets the current step and enables or disables the actions that depend on + * a step as needed. + * + * @param step The step to select, or null to deselect the current one. + */ + void selectStep(Step* step); + +private: + + /** + * The KTutorialEditor to work with. + */ + KTutorialEditor* mTutorialEditor; + + /** + * The currently selected step. + */ + Step* mCurrentStep; + + /** + * Sets up all the edit related actions. + */ + void setupActions(); + +private Q_SLOTS: + + /** + * Enables or disables the "test tutorial from current step" action based on + * the current step. + */ + void updateTestTutorialFromCurrentStepActionState(); + + /** + * Tests the current tutorial in the target application. + */ + void testTutorial(); + + /** + * Tests the current tutorial from the current step in the target + * application. + */ + void testTutorialFromCurrentStep(); + +}; + +#endif Property changes on: trunk/ktutorial/ktutorial-editor/src/TestTutorialActions.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/ktutorial/ktutorial-editor/src/TutorialTester.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/TutorialTester.cpp 2011-06-08 12:46:04 UTC (rev 316) +++ trunk/ktutorial/ktutorial-editor/src/TutorialTester.cpp 2011-06-08 12:48:46 UTC (rev 317) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -33,21 +33,26 @@ TutorialTester::TutorialTester(KTutorialEditor* tutorialEditor): QObject(tutorialEditor), mTutorialEditor(tutorialEditor) { +} - mTargetApplicationView = - new TargetApplicationView(TargetApplication::self(), mTutorialEditor); +void TutorialTester::setStepToTestFrom(const QString& stepId) { + mStepId = stepId; } -//public slots: - void TutorialTester::testTutorial() { if (TargetApplication::self()->remoteEditorSupport()) { sendTutorialToTargetApplication(); } else { connect(TargetApplication::self(), SIGNAL(started()), this, SLOT(sendTutorialToTargetApplication())); + connect(TargetApplication::self(), + SIGNAL(startFailed(TargetApplication::Error)), + this, SLOT(deleteLater())); - mTargetApplicationView->start(); + TargetApplicationView* targetApplicationView = + new TargetApplicationView(TargetApplication::self(), + mTutorialEditor); + targetApplicationView->start(); } } @@ -80,8 +85,13 @@ } try { - TargetApplication::self()->remoteEditorSupport()->testScriptedTutorial( - temporaryFile->fileName()); + if (mStepId.isEmpty()) { + TargetApplication::self()->remoteEditorSupport()-> + testScriptedTutorial(temporaryFile->fileName()); + } else { + TargetApplication::self()->remoteEditorSupport()-> + testScriptedTutorial(temporaryFile->fileName(), mStepId); + } } catch (DBusException e) { QString text = i18nc("@label", "There was a problem when trying to " "tell the target application to start the tutorial:<nl/>%1", e.message()); Modified: trunk/ktutorial/ktutorial-editor/src/TutorialTester.h =================================================================== --- trunk/ktutorial/ktutorial-editor/src/TutorialTester.h 2011-06-08 12:46:04 UTC (rev 316) +++ trunk/ktutorial/ktutorial-editor/src/TutorialTester.h 2011-06-08 12:48:46 UTC (rev 317) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -22,7 +22,6 @@ #include <QObject> class KTutorialEditor; -class TargetApplicationView; /** * Utility class to test a tutorial in the target application, starting it if @@ -39,7 +38,13 @@ */ explicit TutorialTester(KTutorialEditor* tutorialEditor); -public Q_SLOTS: + /** + * Sets the step to test the tutorial from. + * After starting the tutorial, it will be changed to the given step. + * + * @param stepId The id of the step to test the tutorial from. + */ + void setStepToTestFrom(const QString& stepId); /** * Tests the current tutorial in the target application. @@ -56,15 +61,16 @@ KTutorialEditor* mTutorialEditor; /** - * The TargetApplicationView used to start the target application. + * The id of the step to test the tutorial from, if any. */ - TargetApplicationView* mTargetApplicationView; + QString mStepId; private Q_SLOTS: /** * Exports the current tutorial to a temporary Javascript file and sends the - * file name to the target application to test the tutorial. + * file name (and, if set, the step id) to the target application to test + * the tutorial. */ void sendTutorialToTargetApplication(); Modified: trunk/ktutorial/ktutorial-editor/src/ktutorial-editorui.rc =================================================================== --- trunk/ktutorial/ktutorial-editor/src/ktutorial-editorui.rc 2011-06-08 12:46:04 UTC (rev 316) +++ trunk/ktutorial/ktutorial-editor/src/ktutorial-editorui.rc 2011-06-08 12:48:46 UTC (rev 317) @@ -29,6 +29,7 @@ </Menu> <Separator/> <Action name="testTutorial"/> + <Action name="testTutorialFromCurrentStep"/> </Menu> <Menu name="view"> <Menu name="panels"> Modified: trunk/ktutorial/ktutorial-editor/src/targetapplication/RemoteEditorSupport.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/targetapplication/RemoteEditorSupport.cpp 2011-06-08 12:46:04 UTC (rev 316) +++ trunk/ktutorial/ktutorial-editor/src/targetapplication/RemoteEditorSupport.cpp 2011-06-08 12:48:46 UTC (rev 317) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -100,9 +100,16 @@ mRemoteEventSpy = 0; } -void RemoteEditorSupport::testScriptedTutorial(const QString& filename) +void RemoteEditorSupport::testScriptedTutorial(const QString& filename, + const QString& stepId) throw (DBusException) { - QDBusReply<void> reply = call("testScriptedTutorial", filename); + QDBusReply<void> reply; + if (stepId.isEmpty()) { + reply = call("testScriptedTutorial", filename); + } else { + reply = call("testScriptedTutorial", filename, stepId); + } + if (!reply.isValid()) { throw DBusException(reply.error().message()); } Modified: trunk/ktutorial/ktutorial-editor/src/targetapplication/RemoteEditorSupport.h =================================================================== --- trunk/ktutorial/ktutorial-editor/src/targetapplication/RemoteEditorSupport.h 2011-06-08 12:46:04 UTC (rev 316) +++ trunk/ktutorial/ktutorial-editor/src/targetapplication/RemoteEditorSupport.h 2011-06-08 12:48:46 UTC (rev 317) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -117,10 +117,15 @@ /** * Tests the scripted tutorial stored in the file with the given name. * The target application just starts the tutorial and shows it to the user. + * If a step id is given, the tutorial is changed to that step after + * starting. * * @param filename The name of the file that contains the tutorial to test. + * @param stepId The id of the step to change to after starting. */ - void testScriptedTutorial(const QString& filename) throw (DBusException); + void testScriptedTutorial(const QString& filename, + const QString& stepId = QString()) + throw (DBusException); private: Modified: trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/RemoteClassStubs.h =================================================================== --- trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/RemoteClassStubs.h 2011-06-08 12:46:04 UTC (rev 316) +++ trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/RemoteClassStubs.h 2011-06-08 12:48:46 UTC (rev 317) @@ -216,6 +216,7 @@ int mEnableEventSpyCount; int mDisableEventSpyCount; QList<QString> mTestScriptedTutorialFilenames; + QList<QString> mTestScriptedTutorialStepIds; StubEditorSupport(QObject* parent = 0): QObject(parent), mEventSpy(0), @@ -255,8 +256,13 @@ QDBusConnection::sessionBus().unregisterObject("/ktutorial/EventSpy"); } - void testScriptedTutorial(const QString& filename) { + void testScriptedTutorial(const QString& filename, + const QString& stepId = QString()) { mTestScriptedTutorialFilenames.append(filename); + + if (!stepId.isEmpty()) { + mTestScriptedTutorialStepIds.append(stepId); + } } }; Modified: trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/RemoteEditorSupportTest.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/RemoteEditorSupportTest.cpp 2011-06-08 12:46:04 UTC (rev 316) +++ trunk/ktutorial/ktutorial-editor/tests/unit/targetapplication/RemoteEditorSupportTest.cpp 2011-06-08 12:48:46 UTC (rev 317) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -66,7 +66,9 @@ void testDisableEventSpyWhenRemoteEditorSupportIsNotAvailable(); void testTestScriptedTutorial(); + void testTestScriptedTutorialWithStepId(); void testTestScriptedTutorialWhenRemoteEditorSupportIsNotAvailable(); + void testTestScriptedTutorialWithStepIdWhenRemoteEditorSupportIsNotAvailable(); private: @@ -341,8 +343,24 @@ QCOMPARE(mEditorSupport->mTestScriptedTutorialFilenames.count(), 1); QCOMPARE(mEditorSupport->mTestScriptedTutorialFilenames[0], QString("/some/file")); + QCOMPARE(mEditorSupport->mTestScriptedTutorialStepIds.count(), 0); } +void RemoteEditorSupportTest::testTestScriptedTutorialWithStepId() { + RemoteObjectMapper mapper(QDBusConnection::sessionBus().baseService()); + RemoteEditorSupport remoteEditorSupport( + QDBusConnection::sessionBus().baseService(), &mapper); + + remoteEditorSupport.testScriptedTutorial("/some/file", "some step id"); + + QCOMPARE(mEditorSupport->mTestScriptedTutorialFilenames.count(), 1); + QCOMPARE(mEditorSupport->mTestScriptedTutorialFilenames[0], + QString("/some/file")); + QCOMPARE(mEditorSupport->mTestScriptedTutorialStepIds.count(), 1); + QCOMPARE(mEditorSupport->mTestScriptedTutorialStepIds[0], + QString("some step id")); +} + void RemoteEditorSupportTest:: testTestScriptedTutorialWhenRemoteEditorSupportIsNotAvailable() { RemoteObjectMapper mapper(QDBusConnection::sessionBus().baseService()); @@ -355,6 +373,19 @@ DBusException); } +void RemoteEditorSupportTest:: + testTestScriptedTutorialWithStepIdWhenRemoteEditorSupportIsNotAvailable() { + RemoteObjectMapper mapper(QDBusConnection::sessionBus().baseService()); + RemoteEditorSupport remoteEditorSupport( + QDBusConnection::sessionBus().baseService(), &mapper); + + QDBusConnection::sessionBus().unregisterObject("/ktutorial"); + + EXPECT_EXCEPTION(remoteEditorSupport.testScriptedTutorial("/some/file", + "some step id"), + DBusException); +} + QTEST_MAIN(RemoteEditorSupportTest) #include "RemoteEditorSupportTest.moc" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-06-08 12:46:14
|
Revision: 316 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=316&view=rev Author: danxuliu Date: 2011-06-08 12:46:04 +0000 (Wed, 08 Jun 2011) Log Message: ----------- Add support for testing a tutorial from a specific step instead of just from the start. Modified Paths: -------------- trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupport.cpp trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupport.h trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupportAdaptor.cpp trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupportAdaptor.h trunk/ktutorial/ktutorial-library/tests/editorsupport/EditorSupportAdaptorTest.cpp trunk/ktutorial/ktutorial-library/tests/editorsupport/EditorSupportTest.cpp Modified: trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupport.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupport.cpp 2011-05-28 04:00:15 UTC (rev 315) +++ trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupport.cpp 2011-06-08 12:46:04 UTC (rev 316) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -103,7 +103,8 @@ mEventSpy = 0; } -void EditorSupport::testScriptedTutorial(const QString& filename) { +void EditorSupport::testScriptedTutorial(const QString& filename, + const QString& stepId) { ScriptedTutorial* scriptedTutorial = new ScriptedTutorial(filename); if (!scriptedTutorial->isValid()) { @@ -119,6 +120,10 @@ emit started(scriptedTutorial); scriptedTutorial->start(); + + if (!stepId.isEmpty()) { + scriptedTutorial->nextStep(stepId); + } } //private: Modified: trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupport.h =================================================================== --- trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupport.h 2011-05-28 04:00:15 UTC (rev 315) +++ trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupport.h 2011-06-08 12:46:04 UTC (rev 316) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -43,7 +43,8 @@ * disable the EventSpy (as notifying all the events sent by an application * through D-Bus is very costly, the EventSpy should be enabled only when * needed), highlight and stop the highlighting of widgets, and test a scripted - * tutorial (starting the tutorial stored in the given filename). + * tutorial (starting the tutorial stored in the given filename and, optionally, + * from the given step id). * * The object register assigns an id to QObjects to be identified by the remote * KTutorial editor. Using that id, KTutorial editor can request further @@ -121,10 +122,14 @@ /** * Starts the scripted tutorial stored in the given filename. + * If a step id is given, the tutorial is changed to that step after + * starting. * * @param filename The name of the file to read the scripted tutorial from. + * @param stepId The id of the step to change to, if any. */ - void testScriptedTutorial(const QString& filename); + void testScriptedTutorial(const QString& filename, + const QString& stepId = QString()); Q_SIGNALS: Modified: trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupportAdaptor.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupportAdaptor.cpp 2011-05-28 04:00:15 UTC (rev 315) +++ trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupportAdaptor.cpp 2011-06-08 12:46:04 UTC (rev 316) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -57,8 +57,9 @@ mEditorSupport->disableEventSpy(); } -void EditorSupportAdaptor::testScriptedTutorial(const QString& filename) { - mEditorSupport->testScriptedTutorial(filename); +void EditorSupportAdaptor::testScriptedTutorial(const QString& filename, + const QString& stepId) { + mEditorSupport->testScriptedTutorial(filename, stepId); } } Modified: trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupportAdaptor.h =================================================================== --- trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupportAdaptor.h 2011-05-28 04:00:15 UTC (rev 315) +++ trunk/ktutorial/ktutorial-library/src/editorsupport/EditorSupportAdaptor.h 2011-06-08 12:46:04 UTC (rev 316) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -89,10 +89,14 @@ /** * Starts the scripted tutorial stored in the given filename. + * If a step id is given, the tutorial is changed to that step after + * starting. * * @param filename The name of the file to read the scripted tutorial from. + * @param stepId The id of the step to change to, if any. */ - void testScriptedTutorial(const QString& filename); + void testScriptedTutorial(const QString& filename, + const QString& stepId = QString()); private: Modified: trunk/ktutorial/ktutorial-library/tests/editorsupport/EditorSupportAdaptorTest.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/tests/editorsupport/EditorSupportAdaptorTest.cpp 2011-05-28 04:00:15 UTC (rev 315) +++ trunk/ktutorial/ktutorial-library/tests/editorsupport/EditorSupportAdaptorTest.cpp 2011-06-08 12:46:04 UTC (rev 316) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Daniel Calviño Sánchez * + * Copyright (C) 2010-2011 by Daniel Calviño Sánchez * * dan...@gm... * * * * This program is free software; you can redistribute it and/or modify * @@ -25,13 +25,23 @@ #include "EditorSupportAdaptor.h" +#define protected public +#define private public +#include "../Tutorial.h" +#undef private +#undef protected + #include "EditorSupport.h" #include "EventSpy.h" #include "ObjectRegister.h" +#include "../Step.h" #include "../extendedinformation/WidgetHighlighter.h" using extendedinformation::WidgetHighlighter; +//Tutorial* must be declared as a metatype to be used in qvariant_cast +Q_DECLARE_METATYPE(Tutorial*); + namespace editorsupport { class EditorSupportAdaptorTest: public QObject { @@ -54,6 +64,7 @@ void testDisableEventSpy(); void testTestScriptedTutorial(); + void testTestScriptedTutorialWithStepId(); }; @@ -158,8 +169,38 @@ QCOMPARE(startedSpy.count(), 1); } +void EditorSupportAdaptorTest::testTestScriptedTutorialWithStepId() { + KTemporaryFile temporaryFile; + temporaryFile.setSuffix(".js"); + temporaryFile.open(); + + QTextStream out(&temporaryFile); + out << "tutorial.tutorialInformationAsObject().setName(\ +\"Test tutorial\");\n"; + out << "tutorial.addStep(ktutorial.newStep(\"start\"));\n"; + out << "tutorial.addStep(ktutorial.newStep(\"second step\"));\n"; + out << "tutorial.addStep(ktutorial.newStep(\"third step\"));\n"; + out.flush(); + + EditorSupport editorSupport; + EditorSupportAdaptor* adaptor = new EditorSupportAdaptor(&editorSupport); + + //Tutorial* must be registered in order to be used with QSignalSpy + qRegisterMetaType<Tutorial*>("Tutorial*"); + QSignalSpy startedSpy(&editorSupport, SIGNAL(started(Tutorial*))); + + adaptor->testScriptedTutorial(temporaryFile.fileName(), "third step"); + + QCOMPARE(startedSpy.count(), 1); + QVariant argument = startedSpy.at(0).at(0); + + Tutorial* tutorial = qvariant_cast<Tutorial*>(argument); + QVERIFY(tutorial->mCurrentStep); + QCOMPARE(tutorial->mCurrentStep->id(), QString("third step")); } +} + QTEST_MAIN(editorsupport::EditorSupportAdaptorTest) #include "EditorSupportAdaptorTest.moc" Modified: trunk/ktutorial/ktutorial-library/tests/editorsupport/EditorSupportTest.cpp =================================================================== --- trunk/ktutorial/ktutorial-library/tests/editorsupport/EditorSupportTest.cpp 2011-05-28 04:00:15 UTC (rev 315) +++ trunk/ktutorial/ktutorial-library/tests/editorsupport/EditorSupportTest.cpp 2011-06-08 12:46:04 UTC (rev 316) @@ -26,6 +26,7 @@ #define protected public #define private public #include "EditorSupport.h" +#include "../Tutorial.h" #undef private #undef protected @@ -33,7 +34,7 @@ #include "EventSpy.h" #include "ObjectRegister.h" #include "ObjectRegisterAdaptor.h" -#include "../Tutorial.h" +#include "../Step.h" #include "../TutorialInformation.h" #include "../extendedinformation/WidgetHighlighter.h" @@ -87,6 +88,7 @@ void testDisableEventSpy(); void testTestScriptedTutorial(); + void testTestScriptedTutorialWithStepId(); void testTestScriptedTutorialWithInvalidTutorial(); void testObjectRegisterWhenEventSpyNotifiesEventBeforeEndingConstructor(); @@ -267,7 +269,8 @@ temporaryFile.fileName()); QCOMPARE(tutorial->tutorialInformation()->name(), QString("Test tutorial")); - //Ensuring that the tutorial was really started is too cumbersome + QVERIFY(tutorial->mCurrentStep); + QCOMPARE(tutorial->mCurrentStep->id(), QString("start")); QSignalSpy destroyedSpy(tutorial, SIGNAL(destroyed())); @@ -287,6 +290,58 @@ QCOMPARE(destroyedSpy.count(), 1); } +void EditorSupportTest::testTestScriptedTutorialWithStepId() { + KTemporaryFile temporaryFile; + temporaryFile.setSuffix(".js"); + temporaryFile.open(); + + QTextStream out(&temporaryFile); + out << "tutorial.tutorialInformationAsObject().setName(\ +\"Test tutorial\");\n"; + out << "tutorial.addStep(ktutorial.newStep(\"start\"));\n"; + out << "tutorial.addStep(ktutorial.newStep(\"second step\"));\n"; + out << "tutorial.addStep(ktutorial.newStep(\"third step\"));\n"; + out.flush(); + + EditorSupport editorSupport; + + //Tutorial* must be registered in order to be used with QSignalSpy + int tutorialStarType = qRegisterMetaType<Tutorial*>("Tutorial*"); + QSignalSpy startedSpy(&editorSupport, SIGNAL(started(Tutorial*))); + + editorSupport.testScriptedTutorial(temporaryFile.fileName(), "third step"); + + QCOMPARE(startedSpy.count(), 1); + QVariant argument = startedSpy.at(0).at(0); + QCOMPARE(argument.userType(), tutorialStarType); + + Tutorial* tutorial = qvariant_cast<Tutorial*>(argument); + QVERIFY(tutorial->tutorialInformation()); + QCOMPARE(tutorial->tutorialInformation()->id(), + temporaryFile.fileName()); + QCOMPARE(tutorial->tutorialInformation()->name(), QString("Test tutorial")); + + QVERIFY(tutorial->mCurrentStep); + QCOMPARE(tutorial->mCurrentStep->id(), QString("third step")); + + QSignalSpy destroyedSpy(tutorial, SIGNAL(destroyed())); + + //Process deleteLater() + QCoreApplication::sendPostedEvents(tutorial, QEvent::DeferredDelete); + + //Ensure that the tutorial is not deleted before explicitly calling finish + //(for example, if the test tutorial written in the text stream does not + //have a start step) + QCOMPARE(destroyedSpy.count(), 0); + + tutorial->finish(); + + //Process deleteLater() + QCoreApplication::sendPostedEvents(tutorial, QEvent::DeferredDelete); + + QCOMPARE(destroyedSpy.count(), 1); +} + void EditorSupportTest::testTestScriptedTutorialWithInvalidTutorial() { KTemporaryFile temporaryFile; temporaryFile.setSuffix(".js"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |