From 1fda21e7f7ea3c58af8bc87e68c4dd25ab4b4c89 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20D=C5=82ugo=C5=82=C4=99cki?= Date: Sun, 27 Oct 2013 01:30:34 +0200 Subject: [PATCH] VLP-28 Removed helper comments from old code. --- src/kernel/kernel.cpp | 74 +++---------------------------------------- 1 file changed, 5 insertions(+), 69 deletions(-) diff --git a/src/kernel/kernel.cpp b/src/kernel/kernel.cpp index d05e12e..8ab19f1 100644 --- a/src/kernel/kernel.cpp +++ b/src/kernel/kernel.cpp @@ -30,50 +30,26 @@ ************************************************************/ -#include -//#include #include #include -//#include -//#include -//#include #include -#include -#include #include -//#include -//#include -#include #include -//#include -//#include #include #include -//#include #include -#include -//#include -//#include #include #include #include #include #include #include -//#include -//#include -//#include -//#include -//#include #include #include #include #include -//#include -//#include #include #include -#include #include #include @@ -194,6 +170,7 @@ private: /** * number of working interpreters + * @attention Currently not in use */ int Tasks; @@ -247,9 +224,6 @@ void QKernel::closeEvent(QCloseEvent * e) */ QKernel::QKernel() { -// QFont f("Helvetica", 10, QFont::Bold); -// QFont f1("Helvetica", 10, QFont::Normal); -// QFont f2("Times Roman", 10, QFont::Normal); QDir q(REMOTE_PATH); char ss[255]; @@ -262,32 +236,20 @@ QKernel::QKernel() wait_for_info = FALSE; setWindowTitle(PACKAGE_NAME); -// setBackgroundColor(white); -// bar = new QMenuBar(this); -// bar->setFont(f); -// p = new QPopupMenu(); QMenu * programMenu = NULL; -// p->setFont(f2); programMenu = menuBar()->addMenu("&Program"); -// prid = bar->insertItem("&Program", p); programMenu->addAction("Execute", this, SLOT(Run_Prog())); programMenu->addAction("Kill", this, SLOT(KillInterpreter())); -// mid = bar->insertItem("&Machine", p1); machineMenu = menuBar()->addMenu("&Machine"); -// p1 = new QPopupMenu(); machineMenu->addAction("Message", this, SLOT(MessageToNode())); machineMenu->addSeparator(); machineMenu->addAction("Connect", this, SLOT(Connect())); machineMenu->addAction("Disconnect", this, SLOT(Disconnect())); machineMenu->addAction("Info", this, SLOT(Info())); -// machineMenu->setFont(f); -// toolsid = bar->insertItem("&Tools", p2); - -// p2 = new QPopupMenu(); toolsMenu = menuBar()->addMenu("&Tools"); cwid = toolsMenu->addAction("Editor", this, SLOT(Edit())); hid = toolsMenu->addAction("Help", this, SLOT(Help())); @@ -296,27 +258,20 @@ QKernel::QKernel() msgid = toolsMenu->addAction("Info messages", this, SLOT(SetMessages())); msgid->setCheckable(TRUE); msgid->setChecked(TRUE); -// toolsMenu->setItemChecked(msgid, TRUE); toolsMenu->addSeparator(); lockid = toolsMenu->addAction("Lock console", this, SLOT(LockConsole())); unlockid = toolsMenu->addAction("Unlock console", this, SLOT(UnlockConsole())); -// toolsMenu->setItemEnabled(unlockid, FALSE); unlockid->setDisabled(TRUE); LOCKED = FALSE; -// p2->setFont(f); qid = menuBar()->addAction("&Quit", this, SLOT(QuitProc())); -// p->setFont(f); desktop = new QTextEdit(this); -// desktop->setAutoUpdate(TRUE); desktop->setReadOnly(TRUE); -// desktop->setFont(f1); QVBoxLayout * layout = new QVBoxLayout(); layout->setContentsMargins (3, 0, 3, 0); layout->addWidget(desktop); -// layout->addWidget(msg); QWidget *window = new QWidget(); window->setLayout(layout); setCentralWidget(window); @@ -574,7 +529,6 @@ void QKernel::Connect() QPushButton cb("", &d); MESSAGE m; -// d.setFont(QFont("Helvetica", 12, QFont::Bold)); ob.setGeometry(30, 60, 80, 30); ob.setText("Ok"); ob.setDefault(TRUE); @@ -720,7 +674,7 @@ void QKernel::MessageToNode() cb->setGeometry(330, 10, 80, 30); dlg->resize(430, 110); connect(ob, SIGNAL(clicked()), dlg, SLOT(accept())); - connect(cb, SIGNAL(clicked()), dlg, SLOT(reject())); + connect(cb, SIGNAL(clicked()), dlg, SLOT(reject())); if (dlg->exec()) { m.msg_type = MSG_NET; @@ -806,7 +760,7 @@ void QKernel::NetMessage() case MSG_INT: /* pom = find_link_by_ID(msg.param.pword[5]); msg.msg_type = MSG_NET; - msg.param.pword[0] = NET_PROPAGATE; + msg.param.pword[0] = NET_PROPAGATE; send_int(pom, &msg);*/ break; case MSG_VLP: @@ -855,7 +809,7 @@ void QKernel::NetMessage() WriteMessage("Instance not found"); } break; - } /* VLP switch */ + } /* VLP switch */ }/* switch */ break; case NET_CONNECTIONS: @@ -984,7 +938,7 @@ void QKernel::WriteMessage(char *msg) desktop->setReadOnly(FALSE); desktop->append(msg); desktop->setReadOnly(TRUE); -// desktop->setCursorPosition(desktop->blockCount(), 1); + QTextCursor tmpCursor = desktop->textCursor(); tmpCursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor); desktop->setTextCursor(tmpCursor); @@ -1195,14 +1149,6 @@ void QKernel::LockConsole() lockid->setEnabled(FALSE); cwid->setEnabled(FALSE); optid->setEnabled(FALSE); -// menuBar()->setItemEnabled(qid, FALSE); -// bar->setItemEnabled(prid, FALSE); -// bar->setItemEnabled(mid, FALSE); -// p2->setItemEnabled(unlockid, TRUE); -// p2->setItemEnabled(lockid, FALSE); -// p2->setItemEnabled(cwid, FALSE); -// p2->setItemEnabled(optid, FALSE); - bar->repaint(); WriteMessage("CONSOLE LOCKED"); LOCKED = TRUE; } else { @@ -1255,14 +1201,6 @@ void QKernel::UnlockConsole() lockid->setEnabled(TRUE); cwid->setEnabled(TRUE); optid->setEnabled(TRUE); -// bar->setItemEnabled(qid, TRUE); -// bar->setItemEnabled(prid, TRUE); -// bar->setItemEnabled(mid, TRUE); -// p2->setItemEnabled(unlockid, FALSE); -// p2->setItemEnabled(lockid, TRUE); -// p2->setItemEnabled(cwid, TRUE); -// p2->setItemEnabled(optid, TRUE); -// bar->repaint(); WriteMessage("CONSOLE UNLOCKED"); LOCKED = FALSE; } else { @@ -1562,9 +1500,7 @@ int main(int argc, char **argv) } app = new QApplication(argc, argv); -// app->setStyle(new QWindowsStyle()); QKernel kernel; -// app->setCentralWidget(&kernel); kernel.show(); kernel.InitMessage(); -- 2.30.2