summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Main.cc25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/Main.cc b/src/Main.cc
index e624478..2bd0b0a 100644
--- a/src/Main.cc
+++ b/src/Main.cc
@@ -15,6 +15,8 @@
#include "Confirm.h"
#include "Table.h"
#include "InPipe.h"
+#include "Image.h"
+#include "CopyJob.h"
InPipe * in;
@@ -23,8 +25,8 @@ class ad_t : public Action {
ad_t() : Action("menu6") { }
virtual ~ad_t() { }
virtual String GetTitle() { return "Action dynamique"; }
- virtual Task * Do(Variables * v, Handle * h) {
- String ut, un;
+ virtual Task * Do(Variables * v, Variables * hds, Handle * h) {
+ String ut, un, shds;
if (!fork()) {
execlp("uptime", "uptime", NULL);
@@ -38,11 +40,22 @@ class ad_t : public Action {
(*in) >> un;
wait(NULL);
+ for (int i = 0; i < hds->GetNb(); i++) {
+ shds += (*hds)[i] + "<BR>\n";
+ }
+
Action * m = new Message("Action dynamique",
String("Vous avez choisi l'action dynamique. L'uptime de la machine est '") +
- ut + "' et sa définition complète est '" + un + "'", "");
+ ut + "' et sa définition complète est '" + un + "'<BR><BR><BR>Voici la liste des entêtes:<BR><BR>" + shds, "");
+
+ Task * t = m->Do(v, hds, h);
+
+ Image * testimg = new Image(100, 100);
+ testimg->Prepare();
+
+ Output * testoutput = new Output("TestImg.tga");
- Task * t = m->Do(v, h);
+ new CopyJob(testimg, testoutput, -1, true, true);
delete m;
return t;
@@ -61,10 +74,10 @@ String Titres[] = {"Titre 1", "Titre 2", "Titre 3"};
String Cells[] = {"L1C1", "L1C2", "L1C3", "L2C1", "L2C2", "L2C3", "L3C1", "L3C2", "L3C3", "L4C1", "L4C2", "L4C3"};
Action * a1 = new Message("Action 1", "Vous avez cliqué sur l'option 1 du menu", "menu1");
Action * a2 = new Table("Petite table", "menu2", Titres, Cells, 3, 4);
-Action * a3 = new Message("Schéma EA",
+Action * a3 = new Message("Test d'image",
"Voici un test d'affichage d'image:"
"<center><table border=0><td><tr><img src=\"/image/nobis-logo-small.jpg\"></tr></td></table></center>",
-"schemaea");
+"menu3");
Action * a4 = new Form("Test de formulaire...", "menu4", "Rentrez des trucs...", Noms, Invites, Defaults, Lists, Descs, 3);
Action * a5 = new Confirm("Confirmation", "Oui ou non?", "menu5", 0, 0);
Action * java = new Message("Applet JAVA",