#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));
}
}