*/
void QKernel::on_actionExecute_triggered()
{
- int i;
QString s = QFileDialog::getOpenFileName(this, "Execute", progdir, "*.log");
if (!s.isNull()) {
- i = s.indexOf(".log");
+ int i = s.indexOf(".log");
if (i > 0)
s.remove(i, 4);
KillInterpreterDialog dialog(this);
dialog.setWindowTitle("Kill interpreter");
- MESSAGE m;
- InterpEntry *interpreter;
-
if (dialog.exec()) {
+ MESSAGE m;
m.msg_type = MSG_INT;
m.param.pword[0] = INT_KILL;
+
+ InterpEntry *interpreter;
interpreter = findINTbyID(dialog.getInterpreterId());
+
if (interpreter != NULL) {
- if (!(interpreter->remote))
+ if (!(interpreter->remote)) {
write(interpreter->sock, &m, sizeof(MESSAGE));
- else
+ }
+ else {
WriteMessage("This is a remote instance of a program!");
+ }
}
else {
WriteMessage("Interpreter not found");
/* TODO: It has to be rewritten */
MESSAGE msg;
int cnt;
- char ss[255];
InterpEntry *pom;
cnt = read(net_sock, &msg, sizeof(MESSAGE));
if ((cnt > 0) && (msg.msg_type == MSG_NET)) {
+ char ss[255];
+
switch(msg.param.pword[0]) {
case NET_CSWRITELN:
WriteMessage(msg.param.pstr);
void QKernel::RemoteInstance(InterpEntry *interp, int on)
{
MESSAGE m;
- char s[255];
m.msg_type = MSG_NET;
m.param.pword[0] = NET_NODE_EXIST;
m.param.pword[1] = interp->RInstances[on];
write(interp->sock, &m, sizeof(MESSAGE));
} else { /* There is no such a node! */
+ char s[255];
sprintf(s, "Warning: Node number %d not found!", on);
WriteMessage(s);
WriteMessage("Allocating O-process on the local node");