Commit 169c2f56 authored by cfouard's avatar cfouard
Browse files

FIXED several bugs of the wizard. Makes it work minimally but without missing parts.

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@149 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 8d8b4971
......@@ -459,12 +459,15 @@ void ExtensionGenerator::generateComponentFiles() throw (QString) {
}
void ExtensionGenerator::writeReport() {
this->devDirectoryName.mkdir("doc");
this->devDirectoryName.cd("doc");
QDir workingDir(devDirectoryName);
workingDir.mkdir("doc");
workingDir.cd("doc");
QString extensionClassName(this->theExtension->extensionClass().c_str());
QString workingDirectory(devDirectoryName.absolutePath());
QString workingDirectory(workingDir.absolutePath());
QString devDirectory(devDirectoryName.absolutePath());
QString typeStr = "";
QString typeDir = "";
QString extension = "";
switch (type) {
case ACTION:
typeStr = "Action";
......@@ -498,40 +501,38 @@ void ExtensionGenerator::writeReport() {
text = in.readLine();
text.replace(QRegExp("@EXTTYPE@"), typeStr);
text.replace(QRegExp("@EXTTYPEDIR@"), typeDir);
text.replace(QRegExp("@WORKDIR@"), workingDirectory);
text.replace(QRegExp("@WORKDIR@"), devDirectory);
text.replace(QRegExp("@EXTENSIONDIR@"), extensionClassName.toLower());
if (text.contains(QRegExp("@IF_ACTION@"))) {
text = in.readLine();
while ( ! text.contains(QRegExp("@ENDIF_ACTION@")) ) {
if (type == ACTION) {
out << text << endl;
}
text = in.readLine();
if ( type != ACTION) {
do {
text = in.readLine();
} while (! text.contains(QRegExp("@ENDIF_ACTION@")));
}
text = in.readLine();
}
if (text.contains(QRegExp("@IF_COMPONENT@"))) {
text = in.readLine();
while ( ! text.contains(QRegExp("@ENDIF_COMPONENT@")) ) {
if (type == COMPONENT) {
out << text << endl;
}
text = in.readLine();
else if (text.contains(QRegExp("@ENDIF_ACTION@"))){
// Go to the next line.
}
else if (text.contains(QRegExp("@IF_COMPONENT@"))) {
if ( type != COMPONENT) {
do {
text = in.readLine();
} while (! text.contains("@ENDIF_COMPONENT@"));
}
text = in.readLine();
}
else if (text.contains("@ENDIF_COMPONENT@")) {
// Go to the next line...
}
out << text << endl;
else {
out << text << endl;
}
} while (! text.isNull());
htmlFile.close();
initFile.close();
// Back to the original sub-directory
this->devDirectoryName.cd("..");
}
void ExtensionGenerator::showReport() {
......
......@@ -27,6 +27,6 @@ void LevelWindow::devClicked() {
}
void LevelWindow::helpClicked() {
QUrl helpUrl("http://camitk.imag.fr/tutorials/developpers/extensions/actionExtension/index.xml");
QUrl helpUrl("http://forge.imag.fr/plugins/mediawiki/wiki/camitk/index.php/Create_an_Extension_with_CamiTK_Wizard");
QDesktopServices::openUrl(helpUrl);
}
......@@ -12,9 +12,9 @@ NewbieWindow::NewbieWindow(QMainWindow * dad) : QMainWindow(dad)
{
ui.setupUi(this);
this->dad = dad;
ui.ApplicationPushButton->setDisabled(true);
// ui.ApplicationPushButton->setDisabled(true);
// ui.ComponentPushButton->setDisabled(true);
ui.viewerPushButton->setDisabled(true);
// ui.viewerPushButton->setDisabled(true);
}
void NewbieWindow::devDirectoryToolButtonClicked() {
......
......@@ -96,27 +96,6 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ApplicationPushButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="wizard.qrc">
<normaloff>:/resources/appli.png</normaloff>
<selectedon>:/resources/appli_bas.png</selectedon>:/resources/appli.png</iconset>
</property>
<property name="iconSize">
<size>
<width>128</width>
<height>128</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ComponentPushButton">
<property name="text">
......@@ -138,26 +117,6 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="viewerPushButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="wizard.qrc">
<normaloff>:/resources/viewer.png</normaloff>:/resources/viewer.png</iconset>
</property>
<property name="iconSize">
<size>
<width>128</width>
<height>128</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......@@ -228,22 +187,6 @@
</hint>
</hints>
</connection>
<connection>
<sender>ApplicationPushButton</sender>
<signal>clicked()</signal>
<receiver>NewbieWindow</receiver>
<slot>applicationButtonClicked()</slot>
<hints>
<hint type="sourcelabel">
<x>242</x>
<y>247</y>
</hint>
<hint type="destinationlabel">
<x>133</x>
<y>272</y>
</hint>
</hints>
</connection>
<connection>
<sender>ComponentPushButton</sender>
<signal>clicked()</signal>
......@@ -260,22 +203,6 @@
</hint>
</hints>
</connection>
<connection>
<sender>viewerPushButton</sender>
<signal>clicked()</signal>
<receiver>NewbieWindow</receiver>
<slot>viewerButtonClicked()</slot>
<hints>
<hint type="sourcelabel">
<x>510</x>
<y>236</y>
</hint>
<hint type="destinationlabel">
<x>464</x>
<y>272</y>
</hint>
</hints>
</connection>
<connection>
<sender>cancel</sender>
<signal>clicked()</signal>
......
......@@ -7,7 +7,6 @@
<h2>Make your @EXTTYPE@ Extension run now</h2>
<ol>
<li>Go to the directory @WORKDIR@</li>
<li>Create a subdirectory named <tt>build</tt></li>
<li>Launch CMake</li>
<li>Set <tt><i>"Where is the source code: "</i></tt> to @WORKDIR@/@EXTENSIONDIR@ </li>
<li>Set <tt><i>"Where is to build the binaries: "</i></tt> to @WORKDIR@/build </li>
......@@ -30,6 +29,7 @@
</li>
<li>your @EXTTYPE@ @EXTENSIONDIR@ now appears on the list of @EXTTYPE@</li>
@IF_ACTION@
<!--
<li> Open a @COMPONENT@ using <tt><i>File / Open</i></tt></li>
<li> Select your Action in the contextual menu:
<ul>
......@@ -40,19 +40,21 @@
<li> Your Action's name, description and parameters appear on the right of Imp's window.
</li>
<li>Click on <tt><i>Apply</i></tt></li>
-->
@ENDIF_ACTION@
@IF_COMPONENT@
<li>Open an example of @EXTENSION@ file:
<li>Open an example of <!-- @EXTENSION@ -->file of the extension you created:
<ul>
<li>Use Imp's <tt><i>File / Open</i></tt></li>
<li>Go to the directory @WORKDIR@/@EXTENSIONDIR@/testdata and choose the file test.@EXTENSION@.</li>
<li>A new .@EXTENSION@ Component just opened in Imp.</li>
<li>Go to the directory @WORKDIR@/@EXTENSIONDIR@/testdata and choose an example file. <!--the file test.@EXTENSION@.--></li>
<li>A new <!--.@EXTENSION@ --> Component just opened in Imp.</li>
</ul>
</li>
@ENDIF_COMPONENT@
</ol>
<!--
<h2>What are the created files</h2>
<h2>It is up to you now...</h2>
-->
</body>
</html>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment