summaryrefslogtreecommitdiffstats
path: root/clients/tde/src/app/remotemdi.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-06-30 14:57:42 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-06-30 14:57:42 -0500
commitb6eb80309781bd02b9b66808d29508f23881de66 (patch)
treec81ca9d23d7c9335f2b7122b011eaed7863a0fb8 /clients/tde/src/app/remotemdi.cpp
parent4dbe57682c156d76db447d814609424bb7e11aca (diff)
downloadulab-b6eb80309781bd02b9b66808d29508f23881de66.tar.gz
ulab-b6eb80309781bd02b9b66808d29508f23881de66.zip
Extend instrument parts
Diffstat (limited to 'clients/tde/src/app/remotemdi.cpp')
-rw-r--r--clients/tde/src/app/remotemdi.cpp39
1 files changed, 33 insertions, 6 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);