From: Rafał Długołęcki Date: Fri, 29 Jan 2016 16:51:19 +0000 (+0100) Subject: Restore compilation of loggraph, extract code layout of kernel's message dialog into... X-Git-Tag: 3.4-b1~20 X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=bb5fb3ccafc4e5cd0dd55134588630c263d0cb9c;p=vlp.git Restore compilation of loggraph, extract code layout of kernel's message dialog into separate ui file --- diff --git a/Makefile.am b/Makefile.am index 9aa17e3..410de45 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,10 +20,10 @@ EXTRA_DIST = \ doc/CodingStyle \ doc/vlp.cfg.sample -# bin/loggraph \ # bin/loghelp bin_PROGRAMS = \ + bin/loggraph \ bin/lognet \ bin/logker \ bin/logint \ @@ -32,7 +32,7 @@ bin_PROGRAMS = \ bin/logcomp BUILT_SOURCES = \ - src/graph/loggraph.moc \ + src/graph/loggraph.moc.cpp \ src/net/lognet.moc.cpp \ src/kernel/kernel.moc.cpp \ src/edit/editor.moc.cpp \ @@ -40,11 +40,13 @@ BUILT_SOURCES = \ src/preproc/prep.moc.cpp \ src/help/help.moc -bin_loggraph_SOURCES = src/graph/loggraph.cpp src/graph/loggraph.moc +bin_loggraph_SOURCES = src/graph/loggraph.cpp src/graph/loggraph.moc.cpp bin_loggraph_CPPFLAGS = $(bin_loggraph_CFLAGS) bin_loggraph_LDADD = $(bin_loggraph_LIBS) -src/graph/loggraph.moc: - $(MOC) -i src/graph/loggraph.cpp -o src/graph/loggraph.moc +bin_lognet_HEADERS = \ + src/graph/loggraph.h +src/graph/loggraph.moc.cpp: + $(MOC) src/graph/loggraph.h -o src/graph/loggraph.moc.cpp clean-loggraph-extra: rm -f src/graph/*.moc.cpp @@ -68,21 +70,29 @@ clean-lognet-extra: bin_logker_SOURCES = \ src/kernel/kernel.cpp \ src/kernel/kernel.moc.cpp \ + src/kernel/ConnectDialog.cpp \ + src/kernel/KillDialog.cpp \ src/kernel/LockDialog.cpp \ src/kernel/OptionsDialog.cpp \ src/kernel/OptionsDialog.moc.cpp \ - src/kernel/KillDialog.cpp \ - src/kernel/ConnectDialog.cpp \ + src/kernel/MessageDialog.cpp \ src/global/vlp/config.cpp bin_logker_CPPFLAGS = $(bin_logker_CFLAGS) bin_logker_LDADD = $(bin_logker_LIBS) -lconfig++ -lX11 bin_logkerdir = src/kernel bin_logker_HEADERS = \ src/kernel/kernel.h \ + src/kernel/ConnectDialog.h \ + src/kernel/KillDialog.h \ src/kernel/LockDialog.h \ src/kernel/OptionsDialog.h \ - src/kernel/KillDialog.h \ - src/kernel/ConnectDialog.h \ + src/kernel/MessageDialog.h \ + src/kernel/ui/KernelWindow.h \ + src/kernel/ui/dialogs/ConnectDialog.h \ + src/kernel/ui/dialogs/KillDialog.h \ + src/kernel/ui/dialogs/LockDialog.h \ + src/kernel/ui/dialogs/OptionsDialog.h \ + src/kernel/ui/dialogs/MessageDialog.h \ src/global/vlp/config.h src/kernel/kernel.moc.cpp: \ src/kernel/kernel.h \ @@ -90,7 +100,8 @@ src/kernel/kernel.moc.cpp: \ src/kernel/ui/dialogs/LockDialog.h \ src/kernel/ui/dialogs/OptionsDialog.h \ src/kernel/ui/dialogs/KillDialog.h \ - src/kernel/ui/dialogs/ConnectDialog.h + src/kernel/ui/dialogs/ConnectDialog.h \ + src/kernel/ui/dialogs/MessageDialog.h moc-qt4 src/kernel/kernel.h -o src/kernel/kernel.moc.cpp moc-qt4 src/kernel/OptionsDialog.h -o src/kernel/OptionsDialog.moc.cpp # $(MOC) -i src/kernel/kernel.cpp -o src/kernel/kernel.moc @@ -110,6 +121,9 @@ src/kernel/ui/dialogs/KillDialog.h: src/kernel/ui/dialogs/ConnectDialog.h: uic src/kernel/ui/dialogs/ConnectDialog.ui -o src/kernel/ui/dialogs/ConnectDialog.h +src/kernel/ui/dialogs/MessageDialog.h: + uic src/kernel/ui/dialogs/MessageDialog.ui -o src/kernel/ui/dialogs/MessageDialog.h + clean-logker-extra: rm -f src/kernel/*.moc diff --git a/src/edit/editor.cpp b/src/edit/editor.cpp index c697a32..ae59c62 100644 --- a/src/edit/editor.cpp +++ b/src/edit/editor.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include @@ -36,6 +35,7 @@ Editor::Editor(int argc, char **argv) if (argc > 1) { strcpy(HomeDir, argv[1]); + fprintf(stderr, "EDIT: HomeDir inited with: %s (%s)\n", HomeDir, argv[1]); } find_text = ""; diff --git a/src/edit/editor.h b/src/edit/editor.h index 01e2e2a..9ff52a5 100644 --- a/src/edit/editor.h +++ b/src/edit/editor.h @@ -1,5 +1,5 @@ -#ifndef QWERTY_H -#define QWERTY_H +#ifndef _VLP_EDITOR_H +#define _VLP_EDITOR_H #include #include @@ -76,4 +76,4 @@ private slots: } } -#endif // QWERTY_H +#endif // _VLP_EDITOR_H diff --git a/src/graph/loggraph.cpp b/src/graph/loggraph.cpp index 4a12ad4..f44ec66 100644 --- a/src/graph/loggraph.cpp +++ b/src/graph/loggraph.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -27,6 +28,7 @@ #include #include #include +#include // #include #include @@ -37,151 +39,18 @@ #define REQUEST_NAME "gr.req" #define PERM 0666 -class VGRMap { -public: - QPixmap *map; - int number; - - VGRMap(int n, QPixmap *m) { - number = n; - map = m; - }; -}; - -class VGR : public QMainWindow { - Q_OBJECT -public: - VGR(char*); - ~VGR(); - - int resp_sock; - int fcol; - int bcol; - int gfcol; - int gbcol; - int curx; - int cury; - int tx; - int ty; - QQueue CharBuffer; - - bool string_wait; - bool char_wait; - bool line_wait; - bool mouse_wait; - bool inkey_wait; - bool was_line; - QColor *lcolors[256]; - QFont *prv_font; - QFont *italic_font; - QFont *bold_font; - QFont *normal_font; - - void MakeColors(); - - void SetForeground(int); - void SetBackground(int); - void ClearAll(); - void ClearArea(int, int, int, int); - - void Line(int, int, int, int); - void Ellipse(int x, int y, int a, int b, int alfa, int beta, int fill); - void Rect(int x1, int y1, int x2, int y2, int col, int fill); - void Point(int x, int y); - void TextXY(int x, int y, char *s); - void CharXY(int x, int y, char a); - void IntXY(int x, int y, int val); - - void WriteText(char *s); - void WriteChar(char a); - void WriteLine(); - - /* Write Char w/o changing position */ - void PutChar(char a); - void DelChar(); - - void Outstring(int x, int y, char *s, int b, int f); - void writeintxy(int x, int y, int val, int c); - void CurPos(); - - int Getmap(int w, int h); - void Putmap(int map); - - void MagicGraph(G_MESSAGE*); - bool GetInput(int); - -public slots: - void vscrolled(int); - void hscrolled(int); - void CloseMe(); - void RequestMessage(); - -protected: - virtual void resizeEvent(QResizeEvent *); - virtual void closeEvent(QCloseEvent *); - virtual void keyPressEvent(QKeyEvent *); - virtual void mousePressEvent(QMouseEvent *); - virtual void paintEvent(QPaintEvent *); - virtual void focusInEvent(QFocusEvent *); - -private: - QPixmap *canvas; - QScrollBar *hscroll; - QScrollBar *vscroll; - QPushButton *close_btn; - int ox,oy,lstep,pstep,gx,gy; - QList maps; - int firstfreemap; - bool Closed; - bool MustRepaint; - bool GraphRead; - QSocketNotifier *request; - char internal_buffer[256]; - int strcnt; -}; - -void VGR::MakeColors() -{ - /* black */ - lcolors[0] = new QColor(0, 0, 0); - /* blue dark */ - lcolors[1] = new QColor(0, 0, 139); - /* green dark */ - lcolors[2] = new QColor(0, 100, 0); - /* turquoise dark */ - lcolors[3] = new QColor(0, 197, 205); - /* red dark */ - lcolors[4] = new QColor(205, 0, 0); - /* violet */ - lcolors[5] = new QColor(238, 130, 238); - /* brown */ - lcolors[6] = new QColor(139,35, 35); - /* grey light */ - lcolors[7] = new QColor(190, 190, 190); - /* grey dark */ - lcolors[8] = new QColor(97, 97, 97); - /* blue */ - lcolors[9] = new QColor(0, 0, 255); - /* green */ - lcolors[10] = new QColor(0, 255, 0); - /* turquoise */ - lcolors[11] = new QColor(0, 229, 238); - /* red light */ - lcolors[12] = new QColor(255, 0, 0); - /* rose */ - lcolors[13] = new QColor(255, 110, 180); - /* yellow */ - lcolors[14] = new QColor(255, 255, 0); - /* white */ - lcolors[15] = new QColor(255, 255, 255); -} +#include "loggraph.h" /* * Construct the DrawView with buttons. */ -VGR::VGR(char *sockname) +VGR::VGR(int argc, char **argv) :QMainWindow() { + char *sockname = argv[1]; + + fprintf(stderr, "GRAPH: sockname inited with: %s (%s)\n", sockname, argv[1]); + QPixmap mp; struct sockaddr_un svr; int len, i, optval, on; @@ -206,14 +75,14 @@ VGR::VGR(char *sockname) tx = ty = 0; gx = gy = 0; - maps.setAutoDelete(TRUE); +// maps.setAutoDelete(TRUE); firstfreemap = 1; Closed = FALSE; GraphRead = FALSE; lstep = 10; pstep = 250; - hscroll = new QScrollBar(0, MAXWIDTH, lstep, pstep, 0, QScrollBar::Horizontal, this); - vscroll = new QScrollBar(0, MAXHEIGHT, lstep, pstep, 0, QScrollBar::Vertical, this); + hscroll = new QScrollBar(0, MAXWIDTH, lstep, pstep, 0, Qt::Orientation::Horizontal, this); + vscroll = new QScrollBar(0, MAXHEIGHT, lstep, pstep, 0, Qt::Orientation::Vertical, this); hscroll->setTracking(TRUE); vscroll->setTracking(TRUE); resize(640, 300); @@ -261,9 +130,9 @@ VGR::VGR(char *sockname) char_wait = line_wait = mouse_wait = FALSE; was_line = FALSE; CharBuffer.clear(); - CharBuffer.setAutoDelete(TRUE); +// CharBuffer.setAutoDelete(TRUE); - setFocusPolicy(QWidget::StrongFocus); + setFocusPolicy(Qt::StrongFocus); hscroll->setRange(0, MAXWIDTH - width() + 20); vscroll->setRange(0, MAXHEIGHT - height() + 20); hscroll->setSteps((int)(hscroll->width() / hscroll->maxValue()), @@ -311,8 +180,9 @@ void VGR::resizeEvent( QResizeEvent *ev ) void VGR::closeEvent(QCloseEvent *ev) { - if (Closed) - QFrame::closeEvent(ev); +// @TODO: Check this +// if (Closed) +// QFrame::closeEvent(ev); } void VGR::mousePressEvent(QMouseEvent *ev) @@ -325,13 +195,13 @@ void VGR::mousePressEvent(QMouseEvent *ev) msg.param.pword[2] = ev->pos().x() - ox; msg.param.pword[3] = ev->pos().y() - oy; switch(ev->button()) { - case LeftButton: + case Qt::LeftButton: msg.param.pword[7] = 1; break; - case RightButton: + case Qt::RightButton: msg.param.pword[7] = 3; break; - case MidButton: + case Qt::MidButton: msg.param.pword[7] = 2; break; default: @@ -342,7 +212,9 @@ void VGR::mousePressEvent(QMouseEvent *ev) mouse_wait = FALSE; } - QFrame::mousePressEvent(ev); + +// @TODO: check +// QFrame::mousePressEvent(ev); } @@ -571,6 +443,25 @@ void VGR::vscrolled(int val) setUpdatesEnabled(FALSE); } +void VGR::MakeColors() +{ + lcolors[0] = new QColor(0, 0, 0 ); /* black */ + lcolors[1] = new QColor(0, 0, 139); /* blue dark */ + lcolors[2] = new QColor(0, 100, 0 ); /* green dark */ + lcolors[3] = new QColor(0, 197, 205 ); /* turquoise dark */ + lcolors[4] = new QColor(205,0 , 0 ); /* red dark */ + lcolors[5] = new QColor(238, 130,238); /* violet */ + lcolors[6] = new QColor(139,35,35 ); /* brown */ + lcolors[7] = new QColor(190,190,190 ); /* grey light */ + lcolors[8] = new QColor(97, 97, 97 ); /* grey dark */ + lcolors[9] = new QColor(0, 0, 255 ); /* blue */ + lcolors[10] = new QColor(0, 255, 0 ); /* green */ + lcolors[11] = new QColor(0, 229,238 ); /* turquoise */ + lcolors[12] = new QColor(255, 0, 0 ); /* red light */ + lcolors[13] = new QColor(255, 110,180 ); /* rose */ + lcolors[14] = new QColor(255,255, 0 ); /* yellow */ + lcolors[15] = new QColor(255, 255, 255 ); /* white */ +} /****************************************/ @@ -950,8 +841,10 @@ int VGR::Getmap(int w, int h) void VGR::Putmap(int map) { VGRMap *m; - m = maps.first(); - while (m != NULL) { + QListIterator mapsIterator(maps); + + while (mapsIterator.hasNext()) { + m = mapsIterator.next(); if (m->number == map) { bitBlt(canvas, curx, cury, m->map, 0, 0, m->map->width(), m->map->height()); @@ -959,7 +852,6 @@ void VGR::Putmap(int map) m->map->width(), m->map->height()); break; } - m = maps.next(); } } @@ -1291,16 +1183,18 @@ void VGR::MagicGraph(G_MESSAGE *msg) } break; /* Kill map */ - case 309: - pmap = maps.first(); - while (pmap != NULL) { + case 309: { + QListIterator mapsIterator(maps); + + while (mapsIterator.hasNext()) { + pmap = mapsIterator.next(); if (msg->param.pword[2] == pmap->number) { maps.remove(pmap); break; } - pmap = maps.next(); } break; + } /* Line (x1,y1,x2,y2,col) */ case 310: f = fcol; @@ -1331,12 +1225,10 @@ void VGR::MagicGraph(G_MESSAGE *msg) }//switch } -#include "loggraph.moc" - int main(int argc, char **argv) { QApplication app(argc, argv); - VGR gs(argv[1]); + VGR gs(argc, argv); gs.show(); return app.exec(); } diff --git a/src/graph/loggraph.h b/src/graph/loggraph.h new file mode 100644 index 0000000..45703bb --- /dev/null +++ b/src/graph/loggraph.h @@ -0,0 +1,147 @@ +#ifndef _VLP_GRAPH_H +#define _VLP_GRAPH_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "genint1.h" +#include "comm.h" +#include "socu.h" +#include +#include +#include +#include +#include +#include +#include +#include +// #include +#include + +#define MAXWIDTH 640 +#define MAXHEIGHT 480 +#define TEXT_LINES 50 +#define TEXT_COLS 100 +#define REQUEST_NAME "gr.req" +#define PERM 0666 + +class VGRMap { +public: + QPixmap *map; + int number; + + VGRMap(int n, QPixmap *m) { + number = n; + map = m; + }; +}; + +class VGR : public QMainWindow { + Q_OBJECT +public: + VGR(int argc, char ** argv); + ~VGR(); + + int resp_sock; + int fcol; + int bcol; + int gfcol; + int gbcol; + int curx; + int cury; + int tx; + int ty; + QQueue CharBuffer; + + bool string_wait; + bool char_wait; + bool line_wait; + bool mouse_wait; + bool inkey_wait; + bool was_line; + QColor *lcolors[256]; + QFont *prv_font; + QFont *italic_font; + QFont *bold_font; + QFont *normal_font; + + void MakeColors(); + + void SetForeground(int); + void SetBackground(int); + void ClearAll(); + void ClearArea(int, int, int, int); + + void Line(int, int, int, int); + void Ellipse(int x, int y, int a, int b, int alfa, int beta, int fill); + void Rect(int x1, int y1, int x2, int y2, int col, int fill); + void Point(int x, int y); + void TextXY(int x, int y, char *s); + void CharXY(int x, int y, char a); + void IntXY(int x, int y, int val); + + void WriteText(char *s); + void WriteChar(char a); + void WriteLine(); + + /* Write Char w/o changing position */ + void PutChar(char a); + void DelChar(); + + void Outstring(int x, int y, char *s, int b, int f); + void writeintxy(int x, int y, int val, int c); + void CurPos(); + + int Getmap(int w, int h); + void Putmap(int map); + + void MagicGraph(G_MESSAGE*); + bool GetInput(int); + +public slots: + void vscrolled(int); + void hscrolled(int); + void CloseMe(); + void RequestMessage(); + +protected: + virtual void resizeEvent(QResizeEvent *); + virtual void closeEvent(QCloseEvent *); + virtual void keyPressEvent(QKeyEvent *); + virtual void mousePressEvent(QMouseEvent *); + virtual void paintEvent(QPaintEvent *); + virtual void focusInEvent(QFocusEvent *); + +private: + QPixmap *canvas; + QScrollBar *hscroll; + QScrollBar *vscroll; + QPushButton *close_btn; + int ox,oy,lstep,pstep,gx,gy; + QList maps; + int firstfreemap; + bool Closed; + bool MustRepaint; + bool GraphRead; + QSocketNotifier *request; + char internal_buffer[256]; + int strcnt; +}; + +#endif /* _VLP_GRAPH_H */ diff --git a/src/kernel/MessageDialog.cpp b/src/kernel/MessageDialog.cpp new file mode 100644 index 0000000..926c73a --- /dev/null +++ b/src/kernel/MessageDialog.cpp @@ -0,0 +1,31 @@ +#include + +#include "MessageDialog.h" + +namespace loglan { +namespace vlp { +namespace dialog { + +MessageDialog::MessageDialog(QWidget * parent) + : QDialog(parent, Qt::Dialog) +{ + setupUi(this); +} + +MessageDialog::~MessageDialog() +{ +} + +int MessageDialog::getNodeNumber() +{ + return spinBox->value(); +} + +QString MessageDialog::getMessage() +{ + return lineEdit->text(); +} + +} +} +} diff --git a/src/kernel/MessageDialog.h b/src/kernel/MessageDialog.h new file mode 100644 index 0000000..cb9d149 --- /dev/null +++ b/src/kernel/MessageDialog.h @@ -0,0 +1,28 @@ +#ifndef _VLP_KERNEL_MESSAGEDIALOG_H +#define _VLP_KERNEL_MESSAGEDIALOG_H + +#include + +#include "ui/dialogs/MessageDialog.h" + +namespace loglan { +namespace vlp { +namespace dialog { + +/** + * Message Dialog class + */ +class MessageDialog : public QDialog, private Ui::MessageDialog { +public: + MessageDialog(QWidget * parent = 0); + ~MessageDialog(); + + int getNodeNumber(); + QString getMessage(); +}; + +} +} +} + +#endif /* _VLP_KERNEL_MESSAGEDIALOG_H */ diff --git a/src/kernel/kernel.cpp b/src/kernel/kernel.cpp index 31cb74d..b39fa3c 100644 --- a/src/kernel/kernel.cpp +++ b/src/kernel/kernel.cpp @@ -66,13 +66,15 @@ #include "kernel.h" #include "ui/KernelWindow.h" +#include "ConnectDialog.h" +#include "KillDialog.h" #include "LockDialog.h" #include "OptionsDialog.h" -#include "KillDialog.h" -#include "ConnectDialog.h" +#include "MessageDialog.h" #include "vlp/config.h" +#include /* File resides in top directory (where are Makefiles)*/ #include "../../config.h" @@ -243,6 +245,7 @@ void QKernel::on_actionEditor_triggered() QString program = getHomeDir(); program += "/modules/logedit"; + fprintf(stderr, "Run EDIT Module: %s, %s\n", program.toStdString().c_str(), getHomeDir()); pid_t pid = fork(); if (pid == 0) { if (execl(program.toStdString().c_str(), @@ -277,6 +280,8 @@ void QKernel::on_actionHelp_triggered() QString docDir = getHomeDir(); docDir += "/doc"; + fprintf(stderr, "Run HELP Module: %s, %s\n", program.toStdString().c_str(), docDir.toStdString().c_str()); + pid_t pid = fork(); if (pid == 0) { if (execl(program.toStdString().c_str(), @@ -309,6 +314,8 @@ void QKernel::RunGraphModule(char *sk) QString program = getHomeDir(); program += "/modules/loggraph"; + fprintf(stderr, "Run GRAPH Module: %s, %s\n", program.toStdString().c_str(), sk); + pid_t pid = fork(); if (pid == 0) { if (execl(program.toStdString().c_str(), @@ -342,6 +349,7 @@ void QKernel::RunGraphModule(char *sk) */ void QKernel::RunNetModule() { + struct sockaddr_un svr; int len; int on; @@ -350,6 +358,7 @@ void QKernel::RunNetModule() QString program = getHomeDir(); program += "/modules/lognet"; + fprintf(stderr, "Run NET Module: %s, %s %s\n", program.toStdString().c_str(), getNetModuleSocket(), getConfigFilePath().toStdString().c_str()); pid_t pid = fork(); if (pid == 0) { if (execl(program.toStdString().c_str(), @@ -474,48 +483,17 @@ void QKernel::on_actionQuit_triggered() */ void QKernel::on_actionMessage_triggered() { - QDialog *dlg; - QLineEdit *nodenr; + dialog::MessageDialog dialog(this); MESSAGE m; - dlg = new QDialog(this, Qt::Dialog); - dlg->setWindowTitle("Send message to node"); - - nodenr = new QLineEdit("number", dlg); - nodenr->setGeometry(90, 10, 50, 30); - nodenr->setText(""); - - QLabel *tmpQLabel; - tmpQLabel = new QLabel("Node number:", dlg); - tmpQLabel->setGeometry(10, 10, 77, 30); - - tmpQLabel = new QLabel("Message:", dlg); - tmpQLabel->setGeometry(10, 50, 70, 30); - - QLineEdit *msg; - msg = new QLineEdit("", dlg); - msg->setGeometry(80, 60, 330, 30); - - QPushButton *ob; - ob = new QPushButton("Send", dlg); - ob->setGeometry(230, 10, 80, 30); - ob->setDefault(TRUE); - - QPushButton *cb; - cb = new QPushButton("Cancel", dlg); - cb->setGeometry(330, 10, 80, 30); - dlg->resize(430, 110); - connect(ob, SIGNAL(clicked()), dlg, SLOT(accept())); - connect(cb, SIGNAL(clicked()), dlg, SLOT(reject())); - - if (dlg->exec()) { + if (dialog.exec()) { m.msg_type = MSG_NET; m.param.pword[0] = NET_PROPAGATE; m.param.pword[1] = MSG_VLP; m.param.pword[2] = NodeNumber; - m.param.pword[4] = atoi(nodenr->text().toAscii().data()); + m.param.pword[4] = dialog.getNodeNumber(); m.param.pword[6] = VLP_WRITE; - strcpy(m.param.pstr, msg->text().toAscii().data()); + strcpy(m.param.pstr, dialog.getMessage().toStdString().c_str()); write(net_sock, &m, sizeof(MESSAGE)); } } @@ -584,17 +562,17 @@ void QKernel::NetMessage() case VLP_WRITE: QApplication::beep(); WriteMessage(CharLine); - WriteMessage( - "### Incoming Messsage ###"); - sprintf(ss, "Mesg from Node %d: %s", - msg.param.pword[2], - msg.param.pstr); + WriteMessage("### Incoming Messsage ###"); + sprintf(ss, + "Mesg from Node %d: %s", + msg.param.pword[2], + msg.param.pstr + ); WriteMessage(ss); WriteMessage(CharLine); break; case VLP_REMOTE_INSTANCE: - sprintf(ss, "%s/%s", getRemoteDir(), - msg.param.pstr); + sprintf(ss, "%s/%s", getRemoteDir(), msg.param.pstr); if (info_messages) { WriteMessage("Running program:"); @@ -679,6 +657,7 @@ void QKernel::IntMessage(int sock) switch (msg.msg_type) { case MSG_GRAPH: if (msg.param.pword[0] == GRAPH_ALLOCATE) { + fprintf(stderr, "Running graph module with arg: %s\n", msg.param.pstr); RunGraphModule(msg.param.pstr); } break; @@ -897,6 +876,7 @@ InterpEntry *QKernel::findINTbyID(int _id) */ InterpEntry *QKernel::RunIntModule(char *ss, int r) { + fprintf(stderr, "Run INT Module: %s, %d\n", ss, r); char a[256], b[255]; struct sockaddr_un svr; int len, sock, on; diff --git a/src/kernel/ui/dialogs/MessageDialog.ui b/src/kernel/ui/dialogs/MessageDialog.ui new file mode 100644 index 0000000..5b5b0b7 --- /dev/null +++ b/src/kernel/ui/dialogs/MessageDialog.ui @@ -0,0 +1,121 @@ + + + MessageDialog + + + + 0 + 0 + 308 + 160 + + + + Send message to node + + + + + + + + + + + 0 + 0 + + + + Node number + + + + + + + + + + + + + + + 0 + 0 + + + + Message + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + Qt::Vertical + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + MessageDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + MessageDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + +