summaryrefslogtreecommitdiffstats
path: root/clients/tde/src
diff options
context:
space:
mode:
Diffstat (limited to 'clients/tde/src')
-rw-r--r--clients/tde/src/app/Makefile.am2
-rw-r--r--clients/tde/src/app/remotemdi.cpp32
-rw-r--r--clients/tde/src/app/remotemdi.h7
3 files changed, 33 insertions, 8 deletions
diff --git a/clients/tde/src/app/Makefile.am b/clients/tde/src/app/Makefile.am
index 80d5986..530c4c3 100644
--- a/clients/tde/src/app/Makefile.am
+++ b/clients/tde/src/app/Makefile.am
@@ -6,4 +6,4 @@ METASOURCES = AUTO
bin_PROGRAMS = remote_laboratory_client
remote_laboratory_client_SOURCES = main.cpp remotemdi.cpp
remote_laboratory_client_LDADD = ./views/libinstrumentview.la $(LIB_KPARTS) $(LIB_TDEUI)
-remote_laboratory_client_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -lkmdi -ltdekrbsocket
+remote_laboratory_client_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -lkmdi -ltdekrbsocket -ltqtrla
diff --git a/clients/tde/src/app/remotemdi.cpp b/clients/tde/src/app/remotemdi.cpp
index 6b89fa5..ae06857 100644
--- a/clients/tde/src/app/remotemdi.cpp
+++ b/clients/tde/src/app/remotemdi.cpp
@@ -12,6 +12,7 @@ using namespace std;
#include <klocale.h>
#include <kdebug.h>
#include <kconfig.h>
+#include <kmessagebox.h>
#include <tqlabel.h>
#include <tqtimer.h>
@@ -110,21 +111,39 @@ void RemoteMDI::connectToServer() {
printf("[DEBUG] Initial connection established...\n\r"); fflush(stdout);
if (m_rsvSvrSocket->setUsingKerberos(true) != 0) {
disconnectFromServer();
+ KMessageBox::error(this, i18n("<qt>Unable to establish Kerberos protocol with remote server<p>Please verify that you currently hold a valid Kerberos ticket</qt>"), i18n("Connection Failed"));
}
else {
// Connection established!
- disconnect_action->setEnabled(true);
-
- // Read the next line from the server
- TQString str = m_rsvSvrSocket->readLine();
- printf("[RAJA DEBUG 200.0] Got %s\n\r", str.ascii()); fflush(stdout);
+ // Read magic number and proto version from server
+ TQDataStream ds(m_rsvSvrSocket);
+ TQ_UINT32 magicnum;
+ TQ_UINT32 protover;
+ ds >> magicnum;
+ ds >> protover;
+ printf("[RAJA DEBUG 200.0] Got magic %d and proto %d\n\r", magicnum, protover); fflush(stdout);
+ if ((magicnum == MAGIC_NUMBER) && (protover == PROTOCOL_VERSION)) {
+ disconnect_action->setEnabled(true);
+
+ // Read the next line from the server
+ TQString str = m_rsvSvrSocket->readLine();
+ printf("[RAJA DEBUG 200.1] Got %s\n\r", str.ascii()); fflush(stdout);
+ }
+ else {
+ disconnectFromServer();
+ KMessageBox::error(this, i18n("<qt>The remote server is not compatible with this client</qt>"), i18n("Connection Failed"));
+ }
}
}
else {
- printf("[ERROR] Initial connection failed (state %d)\n\r", m_rsvSvrSocket->state()); fflush(stdout);
disconnectFromServer();
+ KMessageBox::error(this, i18n("<qt>Unable to establish connection to remote server</qt>"), i18n("Connection Failed"));
}
}
+ else {
+ disconnectFromServer();
+ KMessageBox::error(this, i18n("<qt>The address of the remote server has not been specified</qt>"), i18n("Connection Failed"));
+ }
processLockouts();
}
@@ -148,6 +167,7 @@ void RemoteMDI::disconnectFromServer() {
void RemoteMDI::connectionClosedHandler() {
disconnectFromServer();
+ KMessageBox::error(this, i18n("<qt>The remote server has closed the connection</qt>"), i18n("Connection Terminated"));
}
void RemoteMDI::processLockouts() {
diff --git a/clients/tde/src/app/remotemdi.h b/clients/tde/src/app/remotemdi.h
index 5ccc80d..8bd5f2f 100644
--- a/clients/tde/src/app/remotemdi.h
+++ b/clients/tde/src/app/remotemdi.h
@@ -11,7 +11,12 @@
#include <tqvaluelist.h>
#include <kmdimainfrm.h>
-#include "tdekrbclientsocket.h"
+#include <tdekrbclientsocket.h>
+
+#include <tqtrla.h>
+
+#define MAGIC_NUMBER 1
+#define PROTOCOL_VERSION 1
class KMdiChildView;
class KListBox;