#include "../../config.h"
+namespace loglan {
+namespace vlp {
+
char CharLine[25] = "________________________";
/**
std::vector<std::string> hosts = config.getHosts();
- for (int i = 0; i < hosts.size(); i++) {
+ for (unsigned int i = 0; i < hosts.size(); i++) {
ConnectList.append(new ConnectEntry(hosts[i].c_str()));
}
*/
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);
*/
void QKernel::RunGraphModule(char *sk)
{
- char cmd[255];
-
QString program = getHomeDir();
program += "/modules/loggraph";
{
MESSAGE m;
- ConnectDialog dialog(this);
+ dialog::ConnectDialog dialog(this);
dialog.setWindowTitle("IP Address:");
if (dialog.exec()) {
*/
void QKernel::on_actionKill_triggered()
{
- KillInterpreterDialog dialog(this);
+ dialog::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::WriteMessage(const char *msg)
{
int x;
- int y;
+// int y;
x = desktop->textCursor().blockNumber();
- y = desktop->textCursor().columnNumber();
+// y = desktop->textCursor().columnNumber();
if (x > 100) {
desktop->clear();
*/
void QKernel::on_actionOptions_triggered()
{
- OptionsDialog optionsDialog(getConfigFilePath(), this);
+ dialog::OptionsDialog optionsDialog(getConfigFilePath(), this);
if (optionsDialog.exec()) {
optionsDialog.saveConfig(getConfigFilePath());
*/
void QKernel::on_actionLock_console_triggered()
{
- LockDialog lockDialog(this);
+ dialog::LockDialog lockDialog(this);
if (lockDialog.exec()) {
QString password = lockDialog.getPassword();
*/
void QKernel::on_actionUnlock_console_triggered()
{
- LockDialog lockDialog(this);
+ dialog::LockDialog lockDialog(this);
if (lockDialog.exec()) {
QString password = lockDialog.getPassword();
{
InterpEntry *pom = NULL;
- for (int i = 0; i < Interpreters.size(); i++) {
- if (Interpreters.at(i)->sock == _id) {
- pom = Interpreters.at(i);
+ for (auto interpreter : Interpreters) {
+ if (interpreter->sock == _id) {
+ pom = interpreter;
break;
}
}
{
InterpEntry *pom = NULL;
- for (int i = 0; i < Interpreters.size(); i++) {
- if (Interpreters.at(i)->ID == _id) {
- pom = Interpreters.at(i);
+ for (auto interpreter : Interpreters) {
+ if (interpreter->ID == _id) {
+ pom = interpreter;
break;
}
}
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");
wait_for_info = TRUE;
}
+}
+}
+
/**
* Program main function
* All program arguments but the first one (argv[0]: program name) are saved and
XInitThreads();
QApplication * app = new QApplication(argc, argv);
- QKernel kernel(argc, argv);
+ loglan::vlp::QKernel kernel(argc, argv);
kernel.show();
return app->exec();
-}
+}
\ No newline at end of file