summaryrefslogtreecommitdiffstats
path: root/clients/tde/src/app/views/instrumentview.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-04-30 16:46:20 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-04-30 16:46:20 -0500
commit408e828f4732c9bb4aa3673c87d85109e06c08e1 (patch)
treeecd25f872402cea120a442d3f2744d74d699b675 /clients/tde/src/app/views/instrumentview.cpp
parentf8d372779417eeb809088893ca58ad6a318ab418 (diff)
downloadulab-408e828f4732c9bb4aa3673c87d85109e06c08e1.tar.gz
ulab-408e828f4732c9bb4aa3673c87d85109e06c08e1.zip
Fixups for ca server
Add very preliminary client for ca and TDE
Diffstat (limited to 'clients/tde/src/app/views/instrumentview.cpp')
-rw-r--r--clients/tde/src/app/views/instrumentview.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/clients/tde/src/app/views/instrumentview.cpp b/clients/tde/src/app/views/instrumentview.cpp
new file mode 100644
index 0000000..4b3d92e
--- /dev/null
+++ b/clients/tde/src/app/views/instrumentview.cpp
@@ -0,0 +1,75 @@
+//Author: Timothy Pearson <kb9vqf@pearsoncomputing.net>, (C) 2012
+//Copyright: See COPYING file that comes with this distribution
+
+#include "instrumentview.h"
+
+#include <tqtimer.h>
+
+#include <klibloader.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+
+namespace RemoteLab {
+
+InstrumentView::InstrumentView(const TQString &library, TQWidget *parentWidget, const char *name, WFlags f)
+ : KMdiChildView(parentWidget, name, f)
+ , m_libraryName(library)
+ , m_instrumentPart( 0 )
+{
+ init();
+}
+
+InstrumentView::InstrumentView(const TQString &library, const TQString &caption, TQWidget *parentWidget, const char *name, WFlags f)
+ : KMdiChildView(caption, parentWidget, name, f)
+ , m_libraryName(library)
+ , m_instrumentPart( 0 )
+{
+ init();
+}
+
+InstrumentView::~InstrumentView() {
+ //
+}
+
+void InstrumentView::init() {
+ KLibFactory *factory = KLibLoader::self()->factory(m_libraryName.ascii());
+
+ if (!factory) {
+ KMessageBox::error( this, i18n("TDE could not find the Remote Laboratory Communications Analyzer Part, or the Remote Laboratory Communications Analyzer Part could not be started. Did you make install?") );
+ TQTimer::singleShot(0, this, SLOT(close()));
+ }
+ else {
+ m_instrumentPart = (InstrumentPart *)factory->create(TQT_TQOBJECT(this), "part", "KParts::ReadOnlyPart");
+ }
+}
+
+bool InstrumentView::queryExit() {
+ if( !m_instrumentPart ) //apparently std::exit() still calls this function, and abort() causes a crash..
+ return true;
+
+ m_instrumentPart->closeURL();
+
+ return true;
+}
+
+void InstrumentView::closeConnections() {
+ queryExit();
+}
+
+void InstrumentView::connectServer(TQString server) {
+ if (m_instrumentPart) {
+ m_instrumentPart->openURL(KURL(server));
+ }
+}
+
+/**********************************************
+ SESSION MANAGEMENT
+ **********************************************/
+
+void InstrumentView::saveProperties( KConfig *config ) {
+}
+
+void InstrumentView::readProperties( KConfig *config ) {
+}
+
+} //namespace RemoteLab \ No newline at end of file