2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 private import ui
.Main
;
23 private import gtk
.MainWindow
;
24 private import gtk
.Widget
;
25 private import gtk
.ProgressBar
;
26 private import gtk
.Label
;
27 private import gtk
.VBox
;
29 private import glib
.Spawn
;
31 private import gdk
.Event
;
33 private import compd
.Compiler
;
34 private import compd
.Executor
;
36 private import std
.stdio
;
39 * Executes a command from the compiler
49 void delegate(int) executionEnded
;
51 public bool execute(char[] command
, void delegate(int) executionEnded
)
54 this.executionEnded
= executionEnded
;
56 //writefln("\ncwd : ", std.file.getcwd());
57 //writefln("exec command : %s", command);
61 command
= std
.string
.replace(command
, "\\", "\\\\");
64 Spawn spawn
= new Spawn(command
);
66 int result
= spawn
.commandLineSync(
74 public int getStatus()
79 public char[][] getOutput()
84 public char[][] getError()
89 bool childEnd(Spawn spawn
)
91 exitStatus
= spawn
.exitStatus
;
92 if ( executionEnded
!= null )
94 executionEnded(exitStatus
);
101 * Add the line to the output text view and adds the line to the outputQueue
103 * line = The line received from the child output stream
106 bool appendOutputLine(char[] line
)
108 //writefln("Output - %s", line);
114 * Add the line to the output text view and adds the line to the outputQueue
116 * line = The line received from the child error stream
119 bool appendErrorLine(char[] line
)
121 //writefln("Error - %s", line);