src/kernel/lock.cpp \
src/kernel/options.cpp \
src/kernel/options.moc.cpp \
- src/kernel/kill_interpreter_dialog.cpp
+ src/kernel/kill_interpreter_dialog.cpp \
+ src/kernel/connect_dialog.cpp
bin_logker_CPPFLAGS = $(bin_logker_CFLAGS)
bin_logker_LDADD = $(bin_logker_LIBS) -lconfig++ -lX11
bin_logkerdir = src/kernel
src/kernel/kernel.h \
src/kernel/lock.h \
src/kernel/options.h \
- src/kernel/kill_interpreter_dialog.h
-src/kernel/kernel.moc.cpp: src/kernel/kernel.h src/kernel/ui/kernelwindow.h src/kernel/ui/lock_dialog.h src/kernel/ui/optionsdialog.h src/kernel/ui/kill_dialog.h
+ src/kernel/kill_interpreter_dialog.h \
+ src/kernel/connect_dialog.h
+src/kernel/kernel.moc.cpp: \
+ src/kernel/kernel.h \
+ src/kernel/ui/kernelwindow.h \
+ src/kernel/ui/lock_dialog.h \
+ src/kernel/ui/optionsdialog.h \
+ src/kernel/ui/kill_dialog.h \
+ src/kernel/ui/connect_dialog.h
moc-qt4 src/kernel/kernel.h -o src/kernel/kernel.moc.cpp
moc-qt4 src/kernel/options.h -o src/kernel/options.moc.cpp
# $(MOC) -i src/kernel/kernel.cpp -o src/kernel/kernel.moc
src/kernel/ui/kill_dialog.h:
uic src/kernel/ui/kill_dialog.ui -o src/kernel/ui/kill_dialog.h
+src/kernel/ui/connect_dialog.h:
+ uic src/kernel/ui/connect_dialog.ui -o src/kernel/ui/connect_dialog.h
+
clean-logker-extra:
rm -f src/kernel/*.moc
rm -f src/kernel/ui/kernelwindow.h
rm -f src/kernel/ui/lock_dialog.h
rm -f src/kernel/ui/optionsdialog.h
+ rm -f src/kernel/ui/kill_dialog.h
+ rm -f src/kernel/ui/connect_dialog.h
rm -f bin/logker
bin_logint_SOURCES = \
--- /dev/null
+#include <QtGui/QDialog>
+
+#include "connect_dialog.h"
+
+ConnectDialog::ConnectDialog(QWidget * parent)
+ : QDialog(parent, Qt::Dialog)
+{
+ setupUi(this);
+}
+
+ConnectDialog::~ConnectDialog()
+{
+}
+
+QString ConnectDialog::getAddress()
+{
+ return address->text();
+}
--- /dev/null
+#ifndef _VLP_KERNEL_CONNECTDIALOG_H
+#define _VLP_KERNEL_CONNECTDIALOG_H
+
+#include <QtGui/QDialog>
+#include <QtCore/QString>
+
+#include "ui/connect_dialog.h"
+
+/**
+ * Kill Interpreter Dialog class
+ */
+class ConnectDialog : public QDialog, private Ui::ConnectDialog {
+public:
+ ConnectDialog(QWidget * parent = 0);
+ ~ConnectDialog();
+
+ QString getAddress();
+};
+
+#endif /* _VLP_KERNEL_CONNECTDIALOG_H */
#include "lock.h"
#include "options.h"
#include "kill_interpreter_dialog.h"
+#include "connect_dialog.h"
/* File resides in top directory (where are Makefiles)*/
#include "../../config.h"
*/
void QKernel::on_actionConnect_triggered()
{
- QDialog d(this, Qt::Dialog);
- QLabel lab("IP Address:", &d);
- QLineEdit ed("", &d);
- QPushButton ob("", &d);
- QPushButton cb("", &d);
MESSAGE m;
- ob.setGeometry(30, 60, 80, 30);
- ob.setText("Ok");
- ob.setDefault(TRUE);
- lab.setGeometry(10, 10, 60, 30);
- lab.setText("Address");
- ed.setGeometry(70, 10, 140, 30);
- cb.setGeometry(130, 60, 80, 30);
- cb.setText("Cancel");
- d.resize(240, 100);
-
- connect(&ob, SIGNAL(clicked()), &d, SLOT(accept()));
- connect(&cb, SIGNAL(clicked()), &d, SLOT(reject()));
- if (d.exec()) {
+ ConnectDialog dialog(this);
+ dialog.setWindowTitle("IP Address:");
+
+ if (dialog.exec()) {
m.msg_type = MSG_NET;
m.param.pword[0] = NET_CONNECT_TO;
- strcpy(m.param.pstr, ed.text().toAscii().data());
- write(net_sock, &m, sizeof(MESSAGE));
+ strcpy(m.param.pstr, dialog.getAddress().toStdString().c_str());
+ write(net_sock, &m, sizeof(MESSAGE));
}
}
--- /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>185</width>
+ <height>70</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</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="address"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>ConnectDialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>ConnectDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>