Thread: [Ktutorial-commits] SF.net SVN: ktutorial:[129] trunk/ktutorial/ktutorial-editor/src/view
Status: Alpha
Brought to you by:
danxuliu
From: <dan...@us...> - 2010-03-09 04:53:40
|
Revision: 129 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=129&view=rev Author: danxuliu Date: 2010-03-09 04:53:34 +0000 (Tue, 09 Mar 2010) Log Message: ----------- Fix wrong class/object name for the TutorialInformationWidget Designer generated class. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/view/TutorialInformationWidget.cpp trunk/ktutorial/ktutorial-editor/src/view/TutorialInformationWidget.h trunk/ktutorial/ktutorial-editor/src/view/TutorialInformationWidget.ui Modified: trunk/ktutorial/ktutorial-editor/src/view/TutorialInformationWidget.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/TutorialInformationWidget.cpp 2010-03-09 04:33:47 UTC (rev 128) +++ trunk/ktutorial/ktutorial-editor/src/view/TutorialInformationWidget.cpp 2010-03-09 04:53:34 UTC (rev 129) @@ -27,7 +27,7 @@ QWidget* parent): EditionWidget(parent), mTutorial(tutorial) { - ui = new Ui::TutorialInformationWidgetUi(); + ui = new Ui::TutorialInformationWidget(); ui->setupUi(this); ui->nameLineEdit->setText(tutorial->name()); Modified: trunk/ktutorial/ktutorial-editor/src/view/TutorialInformationWidget.h =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/TutorialInformationWidget.h 2010-03-09 04:33:47 UTC (rev 128) +++ trunk/ktutorial/ktutorial-editor/src/view/TutorialInformationWidget.h 2010-03-09 04:53:34 UTC (rev 129) @@ -24,7 +24,7 @@ class Tutorial; namespace Ui { -class TutorialInformationWidgetUi; +class TutorialInformationWidget; } /** @@ -62,7 +62,7 @@ /** * The Ui Designer generated class. */ - Ui::TutorialInformationWidgetUi* ui; + Ui::TutorialInformationWidget* ui; }; Modified: trunk/ktutorial/ktutorial-editor/src/view/TutorialInformationWidget.ui =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/TutorialInformationWidget.ui 2010-03-09 04:33:47 UTC (rev 128) +++ trunk/ktutorial/ktutorial-editor/src/view/TutorialInformationWidget.ui 2010-03-09 04:53:34 UTC (rev 129) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>TutorialInformationWidgetUi</class> - <widget class="QWidget" name="TutorialInformationWidgetUi"> + <class>TutorialInformationWidget</class> + <widget class="QWidget" name="TutorialInformationWidget"> <property name="geometry"> <rect> <x>0</x> @@ -16,7 +16,7 @@ <property name="whatsThis"> <string comment="@info:whatsthis"><para>Set the name and description of the tutorial.</para><para>The name and the description are shown in the dialog where the tutorial to be started is selected.</para></string> </property> - <layout class="QVBoxLayout" name="tutorialInformationWidgetUiLayout"> + <layout class="QVBoxLayout" name="tutorialInformationWidgetLayout"> <item> <widget class="QGroupBox" name="tutorialInformationGroupBox"> <property name="title"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2010-03-09 20:07:50
|
Revision: 138 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=138&view=rev Author: danxuliu Date: 2010-03-09 20:07:44 +0000 (Tue, 09 Mar 2010) Log Message: ----------- Fix Krazy2 null string assignment issue. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/view/StepTreeItem.cpp trunk/ktutorial/ktutorial-editor/src/view/TutorialTreeItem.cpp Modified: trunk/ktutorial/ktutorial-editor/src/view/StepTreeItem.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/StepTreeItem.cpp 2010-03-09 20:04:23 UTC (rev 137) +++ trunk/ktutorial/ktutorial-editor/src/view/StepTreeItem.cpp 2010-03-09 20:07:44 UTC (rev 138) @@ -59,7 +59,7 @@ if (step->id().isEmpty()) { if (!mStepId.isEmpty()) { - mStepId = QString(); + mStepId.clear(); emit dataChanged(this); } } else { Modified: trunk/ktutorial/ktutorial-editor/src/view/TutorialTreeItem.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/TutorialTreeItem.cpp 2010-03-09 20:04:23 UTC (rev 137) +++ trunk/ktutorial/ktutorial-editor/src/view/TutorialTreeItem.cpp 2010-03-09 20:07:44 UTC (rev 138) @@ -79,7 +79,7 @@ TreeItemUtil::removeFlatItemIfNeeded(mNameItem); if (!mTutorialId.isEmpty()) { - mTutorialId = QString(); + mTutorialId.clear(); emit dataChanged(this); } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2010-03-22 19:19:42
|
Revision: 178 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=178&view=rev Author: danxuliu Date: 2010-03-22 19:19:36 +0000 (Mon, 22 Mar 2010) Log Message: ----------- Fix spacer height hint Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/view/NewWaitForWidget.ui trunk/ktutorial/ktutorial-editor/src/view/WaitForEventWidget.ui trunk/ktutorial/ktutorial-editor/src/view/WaitForSignalWidget.ui Modified: trunk/ktutorial/ktutorial-editor/src/view/NewWaitForWidget.ui =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/NewWaitForWidget.ui 2010-03-22 18:39:46 UTC (rev 177) +++ trunk/ktutorial/ktutorial-editor/src/view/NewWaitForWidget.ui 2010-03-22 19:19:36 UTC (rev 178) @@ -79,7 +79,7 @@ <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>215</height> + <height>20</height> </size> </property> </spacer> Modified: trunk/ktutorial/ktutorial-editor/src/view/WaitForEventWidget.ui =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/WaitForEventWidget.ui 2010-03-22 18:39:46 UTC (rev 177) +++ trunk/ktutorial/ktutorial-editor/src/view/WaitForEventWidget.ui 2010-03-22 19:19:36 UTC (rev 178) @@ -84,7 +84,7 @@ <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>182</height> + <height>20</height> </size> </property> </spacer> Modified: trunk/ktutorial/ktutorial-editor/src/view/WaitForSignalWidget.ui =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/WaitForSignalWidget.ui 2010-03-22 18:39:46 UTC (rev 177) +++ trunk/ktutorial/ktutorial-editor/src/view/WaitForSignalWidget.ui 2010-03-22 19:19:36 UTC (rev 178) @@ -84,7 +84,7 @@ <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>182</height> + <height>20</height> </size> </property> </spacer> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2010-03-29 03:15:44
|
Revision: 206 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=206&view=rev Author: danxuliu Date: 2010-03-29 03:15:38 +0000 (Mon, 29 Mar 2010) Log Message: ----------- Refactor the code to save the trigger and response types Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/view/ReactionWidget.cpp trunk/ktutorial/ktutorial-editor/src/view/ReactionWidget.h Modified: trunk/ktutorial/ktutorial-editor/src/view/ReactionWidget.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/ReactionWidget.cpp 2010-03-29 00:36:12 UTC (rev 205) +++ trunk/ktutorial/ktutorial-editor/src/view/ReactionWidget.cpp 2010-03-29 03:15:38 UTC (rev 206) @@ -51,12 +51,14 @@ connect(ui->responseStepRadioButton, SIGNAL(toggled(bool)), this, SLOT(selectResponseStep(bool))); + mCurrentTriggerType = reaction->triggerType(); if (reaction->triggerType() == Reaction::ConditionMet) { ui->triggerConditionRadioButton->setChecked(true); } else { ui->triggerOptionRadioButton->setChecked(true); } + mCurrentResponseType = reaction->responseType(); if (reaction->responseType() == Reaction::CustomCode) { ui->responseCodeRadioButton->setChecked(true); } else { @@ -106,30 +108,16 @@ commands.append(reactionCommands.setNextStepId(nextStepId, parent)); } - if (mReaction->triggerType() != Reaction::ConditionMet && - ui->triggerConditionRadioButton->isChecked()) { - commands.append(reactionCommands.setTriggerType(Reaction::ConditionMet, + if (mReaction->triggerType() != mCurrentTriggerType) { + commands.append(reactionCommands.setTriggerType(mCurrentTriggerType, parent)); } - if (mReaction->triggerType() != Reaction::OptionSelected && - ui->triggerOptionRadioButton->isChecked()) { - commands.append(reactionCommands.setTriggerType(Reaction::OptionSelected, - parent)); - } - - if (mReaction->responseType() != Reaction::CustomCode && - ui->responseCodeRadioButton->isChecked()) { - commands.append(reactionCommands.setResponseType(Reaction::CustomCode, + if (mReaction->responseType() != mCurrentResponseType) { + commands.append(reactionCommands.setResponseType(mCurrentResponseType, parent)); } - if (mReaction->responseType() != Reaction::NextStep && - ui->responseStepRadioButton->isChecked()) { - commands.append(reactionCommands.setResponseType(Reaction::NextStep, - parent)); - } - return commands; } @@ -142,6 +130,8 @@ ui->triggerOptionLineEdit->setEnabled(false); mWaitForWidget->setEnabled(true); + + mCurrentTriggerType = Reaction::ConditionMet; } void ReactionWidget::selectTriggerOption(bool checked) { @@ -151,6 +141,8 @@ mWaitForWidget->setEnabled(false); ui->triggerOptionLineEdit->setEnabled(true); + + mCurrentTriggerType = Reaction::OptionSelected; } void ReactionWidget::selectResponseStep(bool checked) { @@ -160,6 +152,8 @@ ui->responseCodeTextEdit->setEnabled(false); ui->responseStepLineEdit->setEnabled(true); + + mCurrentResponseType = Reaction::NextStep; } void ReactionWidget::selectResponseCode(bool checked) { @@ -169,4 +163,6 @@ ui->responseStepLineEdit->setEnabled(false); ui->responseCodeTextEdit->setEnabled(true); + + mCurrentResponseType = Reaction::CustomCode; } Modified: trunk/ktutorial/ktutorial-editor/src/view/ReactionWidget.h =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/ReactionWidget.h 2010-03-29 00:36:12 UTC (rev 205) +++ trunk/ktutorial/ktutorial-editor/src/view/ReactionWidget.h 2010-03-29 03:15:38 UTC (rev 206) @@ -22,8 +22,8 @@ #include <QPointer> #include "CommandWidget.h" +#include "../data/Reaction.h" -class Reaction; class WaitFor; class WaitForWidget; @@ -84,6 +84,16 @@ WaitForWidget* mWaitForWidget; /** + * The currently selected trigger type. + */ + Reaction::TriggerType mCurrentTriggerType; + + /** + * The currently selected response type. + */ + Reaction::ResponseType mCurrentResponseType; + + /** * The Ui Designer generated class. */ Ui::ReactionWidget* ui; @@ -92,7 +102,7 @@ /** * When the condition radio button is selected, it enables and disables the - * appropriate widgets. + * appropriate widgets, and updates the current trigger type. * * @param checked Whether the radio button was checked or unchecked. */ @@ -100,7 +110,7 @@ /** * When the option radio button is selected, it enables and disables the - * appropriate widgets. + * appropriate widgets, and updates the current trigger type. * * @param checked Whether the radio button was checked or unchecked. */ @@ -108,7 +118,7 @@ /** * When the custom code radio button is selected, it enables and disables - * the appropriate widgets. + * the appropriate widgets, and updates the current response type. * * @param checked Whether the radio button was checked or unchecked. */ @@ -116,7 +126,7 @@ /** * When the next step radio button is selected, it enables and disables the - * appropriate widgets. + * appropriate widgets, and updates the current response type. * * @param checked Whether the radio button was checked or unchecked. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2010-09-24 17:30:35
|
Revision: 252 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=252&view=rev Author: danxuliu Date: 2010-09-24 17:30:22 +0000 (Fri, 24 Sep 2010) Log Message: ----------- -Fix not restoring the normal cursor shape when the target application was closed before the editor was able to decide whether it supported KTutorial or not. -Fix showing the error message several times if the target application was successfully started several times and then failed to start. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/view/TargetApplicationView.cpp trunk/ktutorial/ktutorial-editor/src/view/TargetApplicationView.h Modified: trunk/ktutorial/ktutorial-editor/src/view/TargetApplicationView.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/TargetApplicationView.cpp 2010-09-21 16:24:13 UTC (rev 251) +++ trunk/ktutorial/ktutorial-editor/src/view/TargetApplicationView.cpp 2010-09-24 17:30:22 UTC (rev 252) @@ -51,13 +51,8 @@ mTargetApplication->setTargetApplicationFilePath(path); } - connect(mTargetApplication, SIGNAL(started()), - this, SLOT(restoreCursor())); - connect(mTargetApplication, SIGNAL(startFailed(TargetApplication::Error)), - this, SLOT(showErrorMessage(TargetApplication::Error))); + startExpectingTheTargetApplicationToStart(); - QApplication::setOverrideCursor(QCursor(Qt::BusyCursor)); - mTargetApplication->start(); } @@ -84,10 +79,28 @@ return executable; } +void TargetApplicationView::startExpectingTheTargetApplicationToStart() { + //Only knowing if the TargetApplication failed to start is relevant in order + //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)); +} + //private slots: void TargetApplicationView::showErrorMessage(TargetApplication::Error error) { - restoreCursor(); + stopExpectingTheTargetApplicationToStart(); QString caption = i18nc("@title:window", "Problem starting the target \ application"); @@ -111,6 +124,13 @@ mTargetApplication->setTargetApplicationFilePath(""); } -void TargetApplicationView::restoreCursor() { +void TargetApplicationView::stopExpectingTheTargetApplicationToStart() { + disconnect(mTargetApplication, SIGNAL(started()), + 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/src/view/TargetApplicationView.h =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/TargetApplicationView.h 2010-09-21 16:24:13 UTC (rev 251) +++ trunk/ktutorial/ktutorial-editor/src/view/TargetApplicationView.h 2010-09-24 17:30:22 UTC (rev 252) @@ -42,7 +42,7 @@ QWidget* parent = 0); /** - * Convenienve method to start the target application. + * Convenience method to start the target application. * It asks for the executable to be executed if the target application does * not have one set yet. When the application is started, the cursor is set * to the busy shape until the target application has started or failed to @@ -70,6 +70,12 @@ */ QString askApplicationFilePath(); + /** + * Connects to the TargetApplication signals and sets the cursor to the busy + * shape. + */ + void startExpectingTheTargetApplicationToStart(); + private Q_SLOTS: /** @@ -81,9 +87,10 @@ void showErrorMessage(TargetApplication::Error error); /** - * Restores the cursor to the normal shape. + * Disconnects from the TargetApplication signals and restores the normal + * cursor. */ - void restoreCursor(); + void stopExpectingTheTargetApplicationToStart(); }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-03-08 04:54:54
|
Revision: 291 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=291&view=rev Author: danxuliu Date: 2011-03-08 04:54:47 +0000 (Tue, 08 Mar 2011) Log Message: ----------- Register also unnamed remote objects to avoid trying to register them again when a child is added to their parent. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameWidget.cpp trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameWidget.h Modified: trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameWidget.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameWidget.cpp 2011-03-08 02:59:37 UTC (rev 290) +++ trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameWidget.cpp 2011-03-08 04:54:47 UTC (rev 291) @@ -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 * @@ -76,12 +76,13 @@ throw (DBusException) { Q_ASSERT(remoteObject); + mRemoteObjectForParent.insert(parent, remoteObject); + if (!remoteObject->name().isEmpty()) { KCompletion* completion = ui->objectNameLineEdit->completionObject(); completion->addItem(remoteObject->name()); mRemoteObjectForName.insert(remoteObject->name(), remoteObject); - mRemoteObjectForParent.insert(parent, remoteObject); } foreach (RemoteObject* child, remoteObject->children()) { Modified: trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameWidget.h =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameWidget.h 2011-03-08 02:59:37 UTC (rev 290) +++ trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameWidget.h 2011-03-08 04:54:47 UTC (rev 291) @@ -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 * @@ -94,7 +94,7 @@ QHash<QString, RemoteObject*> mRemoteObjectForName; /** - * The known RemoteObjects with a name indexed by their parent + * The known RemoteObjects (with and without name) indexed by their parent. */ QMultiHash<RemoteObject*, RemoteObject*> mRemoteObjectForParent; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2011-04-30 17:31:19
|
Revision: 300 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=300&view=rev Author: danxuliu Date: 2011-04-30 17:31:13 +0000 (Sat, 30 Apr 2011) Log Message: ----------- Fix Krazy2 issues (doublequote, spelling and strings). Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameRegister.cpp trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameRegister.h Modified: trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameRegister.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameRegister.cpp 2011-04-30 16:53:54 UTC (rev 299) +++ trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameRegister.cpp 2011-04-30 17:31:13 UTC (rev 300) @@ -66,7 +66,7 @@ for (int i=1; i<reversedFullPath.size(); ++i) { if (ancestorNotInPaths(reversedFullPath[i], reversedPathsToHomonyms)) { - return reversedFullPath[i] + "/" + reversedFullPath[0]; + return reversedFullPath[i] + '/' + reversedFullPath[0]; } } @@ -155,7 +155,7 @@ RemoteObject* parent = remoteObject; while (parent) { QString name = parent->name(); - if (!name.isEmpty() && !name.startsWith("qt_")) { + if (!name.isEmpty() && !name.startsWith(QLatin1String("qt_"))) { reversedPath.append(name); } parent = mRemoteObjectForParent.key(parent); Modified: trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameRegister.h =================================================================== --- trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameRegister.h 2011-04-30 16:53:54 UTC (rev 299) +++ trunk/ktutorial/ktutorial-editor/src/view/RemoteObjectNameRegister.h 2011-04-30 17:31:13 UTC (rev 300) @@ -30,7 +30,7 @@ * Provides information related to the names of the remote objects in the target * application. * RemoteObjectNameRegister can be used to know the names of all the remote - * objects accesible by KTutorial in the target application, and it also + * objects accessible by KTutorial in the target application, and it also * notifies the names of the remote objects added or removed in the target * application through the signals nameAdded(QString) and nameRemoved(QString). * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |