summaryrefslogtreecommitdiffstats
path: root/clients
diff options
context:
space:
mode:
Diffstat (limited to 'clients')
-rw-r--r--clients/tde/src/app/remotemdi.cpp39
-rw-r--r--clients/tde/src/app/remotemdi.h9
-rw-r--r--clients/tde/src/app/views/instrumentview.cpp7
-rw-r--r--clients/tde/src/app/views/instrumentview.h6
-rw-r--r--clients/tde/src/part/fpgaview/Makefile.am2
-rw-r--r--clients/tde/src/part/fpgaview/part.cpp7
-rw-r--r--clients/tde/src/part/fpgaview/part.h4
7 files changed, 63 insertions, 11 deletions
diff --git a/clients/tde/src/app/remotemdi.cpp b/clients/tde/src/app/remotemdi.cpp
index e1d4236..bb12837 100644
--- a/clients/tde/src/app/remotemdi.cpp
+++ b/clients/tde/src/app/remotemdi.cpp
@@ -51,17 +51,19 @@ RemoteMDI::RemoteMDI()
menuBar()->insertItem(i18n("&Window"), windowMenu());
}
+ setMenuForSDIModeSysButtons(menuBar());
+
createGUI( 0 );
// When we change view, change the status bar text
connect(this, SIGNAL(viewActivated(KMdiChildView*)), this, SLOT(currentChanged(KMdiChildView*)));
ac->setHighlightingEnabled(true);
- connect(ac, TQT_SIGNAL(actionStatusText(const TQString&)), statusBar(), TQT_SLOT(message(const TQString&) ));
+ connect(ac, TQT_SIGNAL(actionStatusText(const TQString&)), this, TQT_SLOT(updateStatusBarMainMessage(const TQString&) ));
connect(ac, TQT_SIGNAL(clearStatusText()), statusBar(), TQT_SLOT(clear()));
// Create the status bar
- statusBar()->message(i18n("No view!"));
+ updateStatusBarMainMessage(i18n("No active instruments"));
processActions();
@@ -82,6 +84,28 @@ RemoteMDI::~RemoteMDI()
}
}
+void RemoteMDI::updateStatusBarMessage() {
+ KStatusBar* sb = statusBar();
+ if (sb) {
+ sb->message(m_mainStatusBarMessage + ((m_windowStatusBarMessage != "")?" [" + i18n("Instrument") + ": " + m_windowStatusBarMessage + "]":""));
+ }
+}
+
+void RemoteMDI::updateStatusBarMainMessage(const TQString& message) {
+ m_mainStatusBarMessage = message;
+ updateStatusBarMessage();
+}
+
+void RemoteMDI::updateStatusBarWindowMessage(const TQString& message) {
+ m_windowStatusBarMessage = message;
+ updateStatusBarMessage();
+}
+
+void RemoteMDI::resizeEvent(TQResizeEvent *e) {
+ KMdiMainFrm::resizeEvent(e);
+ setSysButtonsAtMenuPosition();
+}
+
void RemoteMDI::processActions() {
// Add dynamic actions
// RAJA FIXME
@@ -130,6 +154,7 @@ void RemoteMDI::startModule() {
}
RemoteLab::InstrumentView* view = new RemoteLab::InstrumentView(sendingAction->name(), st.name, (mdiMode() == KMdi::ToplevelMode) ? 0 : this);
+ connect(view, SIGNAL(statusMessageSet(const TQString&)), this, SLOT(updateStatusBarWindowMessage(const TQString&)));
openNewWindow(view);
if (m_serverHost != "") {
view->connectServer(m_serverHost);
@@ -227,7 +252,7 @@ void RemoteMDI::connectToServer() {
if (!m_rsvSvrSocket) {
m_rsvSvrSocket = new TDEKerberosClientSocket(this);
connect(m_rsvSvrSocket, SIGNAL(connectionClosed()), this, SLOT(connectionClosedHandler()));
- connect(m_rsvSvrSocket, TQT_SIGNAL(statusMessageUpdated(const TQString&)), statusBar(), TQT_SLOT(message(const TQString&) ));
+ connect(m_rsvSvrSocket, TQT_SIGNAL(statusMessageUpdated(const TQString&)), this, TQT_SLOT(updateStatusBarMainMessage(const TQString&) ));
}
m_rsvSvrSocket->setServiceName("remotefpga");
if (m_serverHost != "") {
@@ -386,7 +411,7 @@ void RemoteMDI::childWindowCloseRequest(KMdiChildView *pWnd) {
void RemoteMDI::currentChanged(KMdiChildView *current) {
// Update status bar and list box
- statusBar()->message(i18n( "%1 activated").arg(current->tabCaption()));
+ updateStatusBarMainMessage(i18n("Instrument %1 activated").arg(current->tabCaption()));
}
void RemoteMDI::closeCurrent() {
@@ -399,7 +424,8 @@ void RemoteMDI::closeCurrent() {
void RemoteMDI::closeSpecifiedWindow(KMdiChildView *window) {
if (window) {
// Notify the status bar of the removal of the window
- statusBar()->message(i18n("%1 removed").arg(window->tabCaption()));
+ updateStatusBarWindowMessage(TQString::null);
+ updateStatusBarMainMessage(i18n("Instrument %1 removed").arg(window->tabCaption()));
// We could also call removeWindowFromMdi, but it doesn't delete the
// pointer. This way, we're sure that the view will get deleted.
@@ -420,7 +446,8 @@ void RemoteMDI::childClosed(KMdiChildView * w) {
assert(w == m_pCurrentWindow);
// Notify the status bar of the removal of the window
- statusBar()->message(i18n("%1 removed").arg(w->tabCaption()));
+ updateStatusBarWindowMessage(TQString::null);
+ updateStatusBarMainMessage(i18n("Instrument %1 removed").arg(w->tabCaption()));
// Remove the view from MDI, BUT DO NOT DELETE IT! It is automatically deleted by TQt since it was closed.
removeWindowFromMdi(w);
diff --git a/clients/tde/src/app/remotemdi.h b/clients/tde/src/app/remotemdi.h
index ccc1fa4..d6dea6c 100644
--- a/clients/tde/src/app/remotemdi.h
+++ b/clients/tde/src/app/remotemdi.h
@@ -58,6 +58,9 @@ class RemoteMDI : public KMdiMainFrm
private slots:
void configToolbars();
void configKeys();
+ void updateStatusBarMessage();
+ void updateStatusBarMainMessage(const TQString& message);
+ void updateStatusBarWindowMessage(const TQString& message);
void connectToServer();
void finishConnectingToServer();
void disconnectFromServer();
@@ -69,8 +72,12 @@ class RemoteMDI : public KMdiMainFrm
protected:
virtual bool queryClose();
+ virtual void resizeEvent(TQResizeEvent *);
+
+ private:
+ TQString m_mainStatusBarMessage;
+ TQString m_windowStatusBarMessage;
- private:
unsigned m_children;
TQString m_serverHost;
diff --git a/clients/tde/src/app/views/instrumentview.cpp b/clients/tde/src/app/views/instrumentview.cpp
index ca3c853..52ce172 100644
--- a/clients/tde/src/app/views/instrumentview.cpp
+++ b/clients/tde/src/app/views/instrumentview.cpp
@@ -43,10 +43,15 @@ void InstrumentView::init() {
TQTimer::singleShot(0, this, SLOT(close()));
}
else {
- m_instrumentPart = (InstrumentPart *)factory->create(TQT_TQOBJECT(this), "part", "KParts::ReadOnlyPart");
+ m_instrumentPart = (InstrumentPart *)factory->create(TQT_TQOBJECT(this), "part", "KParts::RemoteInstrumentPart");
+ connect(m_instrumentPart, SIGNAL(statusMessageSet(const TQString&)), this, SLOT(setStatusMessage(const TQString&)));
}
}
+void InstrumentView::setStatusMessage(const TQString& message) {
+ emit(statusMessageSet(message));
+}
+
bool InstrumentView::queryExit() {
if (!m_instrumentPart) { // apparently std::exit() still calls this function, and abort() causes a crash..
return true;
diff --git a/clients/tde/src/app/views/instrumentview.h b/clients/tde/src/app/views/instrumentview.h
index 64d4d5d..c0343c8 100644
--- a/clients/tde/src/app/views/instrumentview.h
+++ b/clients/tde/src/app/views/instrumentview.h
@@ -29,6 +29,12 @@ class InstrumentView : public KMdiChildView
virtual void saveProperties(KConfig *);
virtual void readProperties(KConfig *);
virtual bool queryExit();
+
+ private slots:
+ void setStatusMessage(const TQString& message);
+
+ signals:
+ void statusMessageSet(const TQString&);
private:
void init();
diff --git a/clients/tde/src/part/fpgaview/Makefile.am b/clients/tde/src/part/fpgaview/Makefile.am
index 60ec9ca..63fdf0f 100644
--- a/clients/tde/src/part/fpgaview/Makefile.am
+++ b/clients/tde/src/part/fpgaview/Makefile.am
@@ -4,6 +4,6 @@ METASOURCES = AUTO
# Part
kde_module_LTLIBRARIES = libremotelab_fpgaviewer.la
-libremotelab_fpgaviewer_la_LIBADD = ../../widgets/libtracewidget.la ../../widgets/libfloatspinbox.la $(LIB_KFILE) $(LIB_KPARTS) $(LIB_TDEUI) $(LIB_QT) -ltdekrbsocket
+libremotelab_fpgaviewer_la_LIBADD = ../../widgets/libtracewidget.la ../../widgets/libfloatspinbox.la $(LIB_KFILE) $(LIB_KPARTS) $(LIB_TDEUI) $(LIB_QT) -ltdekrbsocket -ltqtrla
libremotelab_fpgaviewer_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) $(LIB_TDECORE) $(LIB_TDEUI) -lkio -ltdefx
libremotelab_fpgaviewer_la_SOURCES = part.cpp layout.ui
diff --git a/clients/tde/src/part/fpgaview/part.cpp b/clients/tde/src/part/fpgaview/part.cpp
index 94aca85..316fd48 100644
--- a/clients/tde/src/part/fpgaview/part.cpp
+++ b/clients/tde/src/part/fpgaview/part.cpp
@@ -54,7 +54,7 @@ K_EXPORT_COMPONENT_FACTORY(libremotelab_fpgaviewer, RemoteLab::Factory)
FPGAViewPart::FPGAViewPart(TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name, const TQStringList&)
- : ReadOnlyPart( parent, name ), m_socket(0), m_base(0), connToServerConnecting(false), connToServerState(-1), connToServerTimeoutTimer(NULL)
+ : RemoteInstrumentPart( parent, name ), m_socket(0), m_base(0), connToServerConnecting(false), connToServerState(-1), connToServerTimeoutTimer(NULL)
{
// Initialize mutex
m_connectionMutex = new TQMutex(false);
@@ -200,6 +200,7 @@ printf("[RAJA DEBUG 400.0] Got '%s' from the server\n\r", response.ascii()); ffl
connToServerConnecting = false;
disconnectFromServer();
KMessageBox::error(0, i18n("<qt>Unable to establish connection with backend server<p>Please verify that you are currently connected to a workspace</qt>"), i18n("Connection Failed"));
+ close();
return;
}
else if (response == "ERRNOTAVL") {
@@ -207,6 +208,7 @@ printf("[RAJA DEBUG 400.0] Got '%s' from the server\n\r", response.ascii()); ffl
connToServerConnecting = false;
disconnectFromServer();
KMessageBox::error(0, i18n("<qt>The backend server is not available at this time<p>Please try a different workspace, or try again later</qt>"), i18n("Connection Failed"));
+ close();
return;
}
else if (response == "ERRNOSERV") {
@@ -214,6 +216,7 @@ printf("[RAJA DEBUG 400.0] Got '%s' from the server\n\r", response.ascii()); ffl
connToServerConnecting = false;
disconnectFromServer();
KMessageBox::error(0, i18n("<qt>The active laboratory workspace does not support the requested service</qt>"), i18n("Service Unavailable"));
+ close();
return;
}
else {
@@ -221,6 +224,7 @@ printf("[RAJA DEBUG 400.0] Got '%s' from the server\n\r", response.ascii()); ffl
connToServerConnecting = false;
disconnectFromServer();
KMessageBox::error(0, i18n("<qt>Unable to establish connection with remote server</qt>"), i18n("Connection Failed"));
+ close();
return;
}
break;
@@ -236,6 +240,7 @@ int FPGAViewPart::connectToServer(TQString server) {
}
if (!m_socket) {
m_socket = new TDEKerberosClientSocket(this);
+ connect(m_socket, TQT_SIGNAL(statusMessageUpdated(const TQString&)), this, TQT_SLOT(setStatusMessage(const TQString&) ));
}
m_socket->setServiceName("remotefpga");
m_socket->setServerFQDN(server);
diff --git a/clients/tde/src/part/fpgaview/part.h b/clients/tde/src/part/fpgaview/part.h
index d4285e0..02797d8 100644
--- a/clients/tde/src/part/fpgaview/part.h
+++ b/clients/tde/src/part/fpgaview/part.h
@@ -30,6 +30,8 @@
#include <kparts/part.h>
#include <kurl.h>
+#include <tqtrla.h>
+
class KAboutData;
using KParts::StatusBarExtension;
class TraceWidget;
@@ -40,7 +42,7 @@ class FPGAViewBase;
namespace RemoteLab
{
- class FPGAViewPart : public KParts::ReadOnlyPart
+ class FPGAViewPart : public KParts::RemoteInstrumentPart
{
Q_OBJECT