bin_logker_SOURCES = src/kernel/kernel.cpp src/kernel/kernel.moc.cpp
bin_logker_CPPFLAGS = $(bin_logker_CFLAGS)
bin_logker_LDADD = $(bin_logker_LIBS)
-bin_logkerdir = src/kernel
+bin_logkerdir = src/kernel src/kernel/ui src/kernel/ui/dialogs
bin_logker_HEADERS = \
- src/kernel/kernel.h
-src/kernel/kernel.moc.cpp: src/kernel/kernel.h
+ src/kernel/kernel.h \
+ src/kernel/ui/main-window.h \
+ src/kernel/ui/dialogs/connect.h \
+ src/kernel/ui/dialogs/options.h \
+ src/kernel/ui/dialogs/kill-interpreter.h \
+ src/kernel/ui/dialogs/send-message.h
+
+src/kernel/ui/main-window.h: data/kernel/main-window.ui
+ if [ ! -d src/kernel/ui ]; then mkdir -p src/kernel/ui; fi
+ uic-qt4 data/kernel/main-window.ui -o src/kernel/ui/main-window.h
+src/kernel/ui/dialogs/connect.h: data/kernel/dialogs/connect.ui
+ if [ ! -d src/kernel/ui/dialogs ]; then mkdir -p src/kernel/ui/dialogs; fi
+ uic-qt4 data/kernel/dialogs/connect.ui -o src/kernel/ui/dialogs/connect.h
+src/kernel/ui/dialogs/options.h: data/kernel/dialogs/options.ui
+ if [ ! -d src/kernel/ui/dialogs ]; then mkdir -p src/kernel/ui/dialogs; fi
+ uic-qt4 data/kernel/dialogs/options.ui -o src/kernel/ui/dialogs/options.h
+src/kernel/ui/dialogs/kill-interpreter.h: data/kernel/dialogs/kill-interpreter.ui
+ if [ ! -d src/kernel/ui/dialogs ]; then mkdir -p src/kernel/ui/dialogs; fi
+ uic-qt4 data/kernel/dialogs/kill-interpreter.ui -o src/kernel/ui/dialogs/kill-interpreter.h
+src/kernel/ui/dialogs/send-message.h: data/kernel/dialogs/send-message.ui
+ if [ ! -d src/kernel/ui/dialogs ]; then mkdir -p src/kernel/ui/dialogs; fi
+ uic-qt4 data/kernel/dialogs/send-message.ui -o src/kernel/ui/dialogs/send-message.h
+
+src/kernel/kernel.moc.cpp: $(bin_logker_HEADERS)
moc-qt4 src/kernel/kernel.h -o src/kernel/kernel.moc.cpp
# $(MOC) -i src/kernel/kernel.cpp -o src/kernel/kernel.moc
# qt3-dev-tools:i386
PKG_CHECK_MODULES([bin_loggraph], [qt-mt < 4.0])
PKG_CHECK_MODULES([bin_lognet], [qt-mt < 4.0 libconfig])
-PKG_CHECK_MODULES([bin_logker], [QtCore >= 4.0 QtGui >= 4.0 libconfig])
+PKG_CHECK_MODULES([bin_logker], [QtCore >= 4.0 QtGui >= 4.0 QtUiTools libconfig])
#PKG_CHECK_MODULES([bin_logint], [qt-mt < 4.0])
PKG_CHECK_MODULES([bin_logedit], [QtCore >= 4.0 QtGui >= 4.0 ])
PKG_CHECK_MODULES([bin_lgconfig], [qt-mt < 4.0 libconfig])
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>connectDialog</class>
+ <widget class="QDialog" name="connectDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>259</width>
+ <height>105</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Connect</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Address</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>killInterpreterDialog</class>
+ <widget class="QDialog" name="killInterpreterDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>383</width>
+ <height>45</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="windowTitle">
+ <string>Kill interpreter</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Interp. ID</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit"/>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>optionsDialog</class>
+ <widget class="QDialog" name="optionsDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>412</width>
+ <height>308</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Options</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_8">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Programs directory</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>Virtual Processor properties</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_7">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Node number:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit_2"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="inputMethodHints">
+ <set>Qt::ImhExclusiveInputMask</set>
+ </property>
+ <property name="title">
+ <string>GroupBox</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_6">
+ <item>
+ <widget class="QRadioButton" name="explicit_2">
+ <property name="text">
+ <string>Explicit</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="registration">
+ <property name="text">
+ <string>Registration</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Connection list:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QListView" name="listView"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_5">
+ <item>
+ <widget class="QPushButton" name="addConnection">
+ <property name="text">
+ <string>Add</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="deleteConnection">
+ <property name="text">
+ <string>Del</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>sendMessageDialog</class>
+ <widget class="QDialog" name="sendMessageDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>385</width>
+ <height>270</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Send message to node</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Node number</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="nodeNumber"/>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Message</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPlainTextEdit" name="message"/>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>386</width>
+ <height>217</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>MainWindow</string>
+ </property>
+ <widget class="QWidget" name="centralwidget">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QTextEdit" name="desktop">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="acceptDrops">
+ <bool>false</bool>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ <property name="acceptRichText">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>386</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menuProgram">
+ <property name="title">
+ <string>Program</string>
+ </property>
+ <addaction name="actionExecute"/>
+ <addaction name="actionKill"/>
+ </widget>
+ <widget class="QMenu" name="menuMachine">
+ <property name="title">
+ <string>Machine</string>
+ </property>
+ <addaction name="actionMessage"/>
+ <addaction name="separator"/>
+ <addaction name="actionConnect"/>
+ <addaction name="actionDisconnect"/>
+ <addaction name="actionInfo"/>
+ </widget>
+ <widget class="QMenu" name="menuTools">
+ <property name="title">
+ <string>Tools</string>
+ </property>
+ <addaction name="actionEditor"/>
+ <addaction name="actionHelp"/>
+ <addaction name="separator"/>
+ <addaction name="actionOptions"/>
+ <addaction name="actionInfo_messages"/>
+ <addaction name="separator"/>
+ <addaction name="actionLock_Console"/>
+ <addaction name="actionUnlock_console"/>
+ </widget>
+ <addaction name="menuProgram"/>
+ <addaction name="menuMachine"/>
+ <addaction name="menuTools"/>
+ </widget>
+ <widget class="QStatusBar" name="statusbar"/>
+ <action name="actionExecute">
+ <property name="text">
+ <string>Execute</string>
+ </property>
+ </action>
+ <action name="actionKill">
+ <property name="text">
+ <string>Kill</string>
+ </property>
+ </action>
+ <action name="actionConnect">
+ <property name="text">
+ <string>Connect</string>
+ </property>
+ </action>
+ <action name="actionDisconnect">
+ <property name="text">
+ <string>Disconnect</string>
+ </property>
+ </action>
+ <action name="actionInfo">
+ <property name="text">
+ <string>Info</string>
+ </property>
+ </action>
+ <action name="actionEditor">
+ <property name="text">
+ <string>Editor</string>
+ </property>
+ </action>
+ <action name="actionHelp">
+ <property name="text">
+ <string>Help</string>
+ </property>
+ </action>
+ <action name="actionOptions">
+ <property name="text">
+ <string>Options</string>
+ </property>
+ </action>
+ <action name="actionInfo_messages">
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Info messages</string>
+ </property>
+ </action>
+ <action name="actionLock_Console">
+ <property name="text">
+ <string>Lock console</string>
+ </property>
+ </action>
+ <action name="actionUnlock_console">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Unlock console</string>
+ </property>
+ </action>
+ <action name="actionMessage">
+ <property name="text">
+ <string>Message</string>
+ </property>
+ </action>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
#include <libconfig.h>
#include "kernel.h"
+#include "send-message.h"
/* File resides in top directory (where are Makefiles)*/
#include "../../config.h"
{
LOCKED = locked;
- quitAction->setDisabled(locked);
- programExecuteAction->setDisabled(locked);
- programKillAction->setDisabled(locked);
- machineMessageAction->setDisabled(locked);
- machineConnectAction->setDisabled(locked);
- machineDisconnectAction->setDisabled(locked);
- machineInfoAction->setDisabled(locked);
+ actionExecute->setDisabled(locked);
+ actionKill->setDisabled(locked);
+ actionConnect->setDisabled(locked);
+ actionDisconnect->setDisabled(locked);
+ actionInfo_messages->setDisabled(locked);
+ actionMessage->setDisabled(locked);
/* Enable only menu entry for unlocking */
- toolsEditorAction->setDisabled(locked);
- toolsOptionsAction->setDisabled(locked);
- toolsLockAction->setDisabled(locked);
- toolsUnlockAction->setEnabled(locked);
+ actionEditor->setDisabled(locked);
+ actionOptions->setDisabled(locked);
+ actionLock_Console->setDisabled(locked);
+ actionUnlock_console->setEnabled(locked);
}
/**
* Kernel program constructor.
* Prepares everything to work.
*/
-QKernel::QKernel()
+QKernel::QKernel(QWidget *parent)
+ : QMainWindow(parent)
{
+ setupUi(this);
+
QDir q(REMOTE_PATH);
char ss[255];
setWindowTitle(PACKAGE_NAME);
- QMenu * programMenu = NULL;
- programMenu = menuBar()->addMenu("&Program");
- programExecuteAction = programMenu->addAction("Execute", this, SLOT(Run_Prog()));
- programKillAction = programMenu->addAction("Kill", this, SLOT(KillInterpreter()));
-
- machineMenu = menuBar()->addMenu("&Machine");
- machineMessageAction = machineMenu->addAction("Message", this, SLOT(MessageToNode()));
- machineMenu->addSeparator();
- machineConnectAction = machineMenu->addAction("Connect", this, SLOT(Connect()));
- machineDisconnectAction = machineMenu->addAction("Disconnect", this, SLOT(Disconnect()));
- machineInfoAction = machineMenu->addAction("Info", this, SLOT(Info()));
-
- toolsMenu = menuBar()->addMenu("&Tools");
- toolsEditorAction = toolsMenu->addAction("Editor", this, SLOT(Edit()));
- toolsMenu->addAction("Help", this, SLOT(Help()));
- toolsMenu->addSeparator();
- toolsOptionsAction = toolsMenu->addAction("Options", this, SLOT(SetOptions()));
- toolsInfoAction = toolsMenu->addAction("Info messages", this, SLOT(SetMessages()));
- toolsInfoAction->setCheckable(TRUE);
- toolsInfoAction->setChecked(TRUE);
- toolsMenu->addSeparator();
- toolsLockAction = toolsMenu->addAction("Lock console", this, SLOT(LockConsole()));
- toolsUnlockAction = toolsMenu->addAction("Unlock console", this,
- SLOT(UnlockConsole()));
- toolsUnlockAction->setDisabled(TRUE);
LOCKED = FALSE;
-
- quitAction = menuBar()->addAction("&Quit", this, SLOT(QuitProc()));
-
- desktop = new QTextEdit(this);
- desktop->setReadOnly(TRUE);
- QVBoxLayout * layout = new QVBoxLayout();
- layout->setContentsMargins (3, 0, 3, 0);
- layout->addWidget(desktop);
- QWidget *window = new QWidget();
- window->setLayout(layout);
- setCentralWidget(window);
-
- resize(400, 200);
Tasks = 0;
freeINTid = 1;
ActiveConnections = 0;
connect(Net_Notify, SIGNAL(activated(int)), this, SLOT(NetMessage()));
}
-/**
- * Event invoked on resizing kernel application window.
- * @copydoc QWidget::resizeEvent(QResizeEvent*)
- */
-void QKernel::resizeEvent(QResizeEvent *ev)
-{
-// QFrame::resizeEvent(ev);
-// if (desktop)
-// desktop->setGeometry(0, bar->height(), width(),
-// height() - bar->height());
-}
-
/**
* Displays window with information about not implemented functionality.
*/
* Executes program.
* Additional window id displayed to set which code to execute.
*/
-void QKernel::Run_Prog()
+void QKernel::on_actionExecute_triggered()
{
int i;
QString s = QFileDialog::getOpenFileName(this, "Execute", progdir, "*.log");
/**
* Invokes editor program
*/
-void QKernel::Edit()
+void QKernel::on_actionEditor_triggered()
{
char cmd[255];
sprintf(cmd, "%s/modules/logedit %s %s %s %s %s %s &", HomeDir, HomeDir,
/**
* Invokes help program
*/
-void QKernel::Help()
+void QKernel::on_actionHelp_triggered()
{
char cmd[255];
sprintf(cmd, "%s/modules/loghelp %s/doc %s %s %s %s %s &", HomeDir,
* Connects to the specified address
* Additional window is displayed to connect to the specified address
*/
-void QKernel::Connect()
+void QKernel::on_actionConnect_triggered()
{
QDialog d(this, Qt::Dialog);
QLabel lab("IP Address:", &d);
/**
* Disconnects from virtual machine
*/
-void QKernel::Disconnect()
+void QKernel::on_actionDisconnect_triggered()
{
MESSAGE msg;
* Additional window is displayed to set Node Number of node where send message,
* and textfield to enter message.
*/
-void QKernel::MessageToNode()
+void QKernel::on_actionMessage_triggered()
{
- QDialog *dlg;
- QLineEdit *nodenr;
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()));
+ SendMessageDialog *dlg;
+ dlg = new SendMessageDialog(this);
if (dlg->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] = dlg->getNodeNumber();
m.param.pword[6] = VLP_WRITE;
- strcpy(m.param.pstr, msg->text().toAscii().data());
+ strcpy(m.param.pstr, dlg->getMessage().toAscii().data());
write(net_sock, &m, sizeof(MESSAGE));
}
}
* Additional window is displayed to get ID of interpreter which should be
* killed.
*/
-void QKernel::KillInterpreter()
+void QKernel::on_actionKill_triggered()
{
QDialog *dlg;
QLineEdit *nodenr;
* Adds checkbox to menu item. If it is checked additional info messages are
* shown.
*/
-void QKernel::SetMessages()
+void QKernel::on_actionInfo_messages_triggered()
{
- if (toolsMenu != NULL) {
- toolsInfoAction->setChecked(!toolsInfoAction->isChecked());
-// toolsInfoAction->toggle();
- info_messages = toolsInfoAction->isChecked();
- fprintf(stderr, "Info is checked? %s\n", toolsInfoAction->isChecked() ? "yes" : "no");
+ if (menuTools != NULL) {
+ info_messages = actionInfo_messages->isChecked();
}
-// menuBar()->repaint();
}
/**
* Additional window is displayed to set kernel options which are saved in
* vlp.cfg file in kernel executable directory.
*/
-void QKernel::SetOptions()
+void QKernel::on_actionOptions_triggered()
{
QDialog dlg(this, Qt::Dialog);
dlg.setWindowTitle("Options");
* Additional window is displayed to enter password and retype it. If both are
* same kernel window is locked.
*/
-void QKernel::LockConsole()
+void QKernel::on_actionLock_Console_triggered()
{
QDialog d(this, Qt::Dialog);
d.setWindowTitle("Lock console");
* Additional window is displayed to enter password. If it is correct, kernel
* window is unlocked
*/
-void QKernel::UnlockConsole()
+void QKernel::on_actionUnlock_console_triggered()
{
QDialog d(this, Qt::Dialog);
d.setWindowTitle("Enter password");
/**
* Displays information about virtual machine
*/
-void QKernel::Info()
+void QKernel::on_actionInfo_triggered()
{
MESSAGE m;
}
QApplication * app = new QApplication(argc, argv);
+
QKernel kernel;
+
kernel.show();
kernel.InitMessage();
#include <QtCore/QSocketNotifier>
#include "comm.h"
+#include "ui/main-window.h"
#define GPATH "loggr"
#define IPATH "logi"
/**
* Kernel class
*/
-class QKernel : public QMainWindow {
+class QKernel : public QMainWindow, private Ui::MainWindow {
Q_OBJECT
public:
- QTextEdit *desktop;
- QMenuBar *bar;
- QMenu *programMenu;
- QMenu *machineMenu;
- QMenu *toolsMenu;
char progdir[256];
int NodeNumber;
int ConType;
- QKernel();
-
- virtual void resizeEvent(QResizeEvent *ev);
+ QKernel(QWidget *parent = 0);
void WriteMessage(char* msg);
void InitMessage();
public slots:
void n_impl();
- void Run_Prog();
- void Edit();
- void Help();
- void SetOptions();
+ void on_actionExecute_triggered();
+ void on_actionEditor_triggered();
+ void on_actionHelp_triggered();
+ void on_actionOptions_triggered();
void AddAddress();
void DelAddress();
- void LockConsole();
- void UnlockConsole();
- void MessageToNode();
+ void on_actionLock_Console_triggered();
+ void on_actionUnlock_console_triggered();
+ void on_actionMessage_triggered();
void QuitProc();
void NetMessage();
void IntMessage(int);
- void KillInterpreter();
- void Disconnect();
- void SetMessages();
- void Connect();
- void Info();
+ void on_actionKill_triggered();
+ void on_actionDisconnect_triggered();
+ void on_actionInfo_messages_triggered();
+ void on_actionConnect_triggered();
+ void on_actionInfo_triggered();
protected:
virtual void closeEvent (QCloseEvent * e);
bool synchro;
bool wait_for_info;
char LockPasswd[25];
- QAction * toolsEditorAction;
- QAction * toolsOptionsAction;
- QAction * toolsInfoAction;
- QAction * programExecuteAction;
- QAction * programKillAction;
- QAction * machineMessageAction;
- QAction * machineConnectAction;
- QAction * machineDisconnectAction;
- QAction * machineInfoAction;
- QAction * toolsLockAction;
- QAction * toolsUnlockAction;
- QAction * quitAction;
int net_sock;
int freeINTid;
--- /dev/null
+/**************************************************************
+
+ Copyright (C) 2013 Rafał Długołęcki
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+
+
+ NOTE: This software is using the free software license of
+ the QT library v.1.30 from Troll Tech AS.
+ See the file LICENSE.QT.
+
+************************************************************/
+
+#ifndef VLP_SEND_MESSAGE_H
+#define VLP_SEND_MESSAGE_H
+
+#include <QtGui/QDialog>
+#include <QtCore/QString>
+#include <stdlib.h>
+
+#include "ui/dialogs/send-message.h"
+
+/**
+ * Class responsible for displaying dialog for sending messages
+ */
+class SendMessageDialog : public QDialog, private Ui::sendMessageDialog {
+public:
+ /**
+ * Constructs a SendMessageDialog with parent 'parent'.
+ * The widget flags f are passed on to the QWidget constructor.
+ *
+ * @param parent parent widget of this dialog
+ * @param flags QDialog flags of this dialog
+ */
+ SendMessageDialog(QWidget * parent = 0, Qt::WindowFlags flags = 0 ) :
+ QDialog(parent, flags)
+ {
+ setupUi(this);
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ }
+
+ /**
+ * Returns entered in dialog node number
+ * @return node number from this dialog textfield
+ */
+ int getNodeNumber()
+ {
+ return atoi(nodeNumber->text().toAscii().data());
+ }
+
+ /**
+ * Returns entered in dialog message
+ * @return message from this dialog textarea
+ */
+ QString getMessage()
+ {
+ return message->toPlainText();
+ }
+};
+
+
+#endif /* VLP_SEND_MESSAGE_H */