From: Rafał Długołęcki Date: Tue, 29 Oct 2013 20:56:52 +0000 (+0100) Subject: vlp-27 Replaced hardcoded dialog for killing interpreters with QtDesigner generated... X-Git-Tag: 3.1.2-a3~3 X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=00f4996d5c0fee841fd51e26f1576100aa1add7d;p=vlp.git vlp-27 Replaced hardcoded dialog for killing interpreters with QtDesigner generated one. --- diff --git a/data/kernel/dialogs/kill-interpreter.ui b/data/kernel/dialogs/kill-interpreter.ui index 433b023..237e3fe 100644 --- a/data/kernel/dialogs/kill-interpreter.ui +++ b/data/kernel/dialogs/kill-interpreter.ui @@ -28,7 +28,7 @@ - + diff --git a/data/kernel/dialogs/options.ui b/data/kernel/dialogs/options.ui index af16c99..bf75758 100644 --- a/data/kernel/dialogs/options.ui +++ b/data/kernel/dialogs/options.ui @@ -24,7 +24,7 @@ - + diff --git a/src/kernel/kernel.cpp b/src/kernel/kernel.cpp index 6c0f27c..8321476 100644 --- a/src/kernel/kernel.cpp +++ b/src/kernel/kernel.cpp @@ -65,6 +65,7 @@ #include "kernel.h" #include "send-message.h" +#include "kill-interpreter.h" /* File resides in top directory (where are Makefiles)*/ #include "../../config.h" @@ -483,7 +484,7 @@ void QKernel::on_actionMessage_triggered() { MESSAGE m; SendMessageDialog *dlg; - dlg = new SendMessageDialog(this); + dlg = new SendMessageDialog(this, Qt::Dialog); if (dlg->exec()) { m.msg_type = MSG_NET; @@ -504,35 +505,16 @@ void QKernel::on_actionMessage_triggered() */ void QKernel::on_actionKill_triggered() { - QDialog *dlg; - QLineEdit *nodenr; MESSAGE m; InterpEntry *pom; + KillInterpreterDialog *dlg; - dlg = new QDialog(this, Qt::Dialog); - dlg->setWindowTitle("Kill interpreter"); - - nodenr = new QLineEdit("", dlg); - nodenr->setGeometry(90, 10, 50, 30); - - QLabel * tmpQLabel = new QLabel("Interp. ID:", dlg); - tmpQLabel->setGeometry(10, 10, 77, 30); - - QPushButton * ob = new QPushButton("Kill", dlg); - ob->setGeometry( 160, 10, 80, 30); - ob->setDefault(TRUE); - - QPushButton * cb = new QPushButton("Cancel", dlg); - cb->setGeometry(260, 10, 80, 30); - dlg->resize(360, 50); - - connect(ob, SIGNAL(clicked()), dlg, SLOT(accept())); - connect(cb, SIGNAL(clicked()), dlg, SLOT(reject())); + dlg = new KillInterpreterDialog(this, Qt::Dialog); if (dlg->exec()) { m.msg_type = MSG_INT; m.param.pword[0] = INT_KILL; - pom = findINTbyID(atoi(nodenr->text().toAscii().data())); + pom = findINTbyID(dlg->getNodeNumber()); if (pom != NULL) { if (!(pom->remote)) write(pom->sock, &m, sizeof(MESSAGE));