vlp-27 Replaced hardcoded dialog for killing interpreters with QtDesigner generated...
authorRafał Długołęcki <kontakt@dlugolecki.net.pl>
Tue, 29 Oct 2013 20:56:52 +0000 (21:56 +0100)
committerRafał Długołęcki <kontakt@dlugolecki.net.pl>
Tue, 29 Oct 2013 20:56:52 +0000 (21:56 +0100)
data/kernel/dialogs/kill-interpreter.ui
data/kernel/dialogs/options.ui
src/kernel/kernel.cpp

index 433b023236068a68ff42e3b405e590b07d87365a..237e3fe03263d39a8023d0f0d7bb0c7adb37d1ef 100644 (file)
@@ -28,7 +28,7 @@
     </widget>
    </item>
    <item>
-    <widget class="QLineEdit" name="lineEdit"/>
+    <widget class="QLineEdit" name="nodeNumber"/>
    </item>
    <item>
     <widget class="QDialogButtonBox" name="buttonBox">
index af16c99bdcc369d47bd565f3ea4d2976815f4087..bf757582ad94595c1940ffc8ce688e8422b8f8b1 100644 (file)
@@ -24,7 +24,7 @@
       </widget>
      </item>
      <item>
-      <widget class="QLineEdit" name="lineEdit"/>
+      <widget class="QLineEdit" name="homeDirectory"/>
      </item>
     </layout>
    </item>
index 6c0f27c72c413cb164865d2671dcc2e667bc618c..8321476ff915e4c37d017939894065d160f132e9 100644 (file)
@@ -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));