diff options
| author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-06-30 14:57:42 -0500 |
|---|---|---|
| committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-06-30 14:57:42 -0500 |
| commit | b6eb80309781bd02b9b66808d29508f23881de66 (patch) | |
| tree | c81ca9d23d7c9335f2b7122b011eaed7863a0fb8 /lib/libtqtrla/src | |
| parent | 4dbe57682c156d76db447d814609424bb7e11aca (diff) | |
| download | ulab-b6eb80309781bd02b9b66808d29508f23881de66.tar.gz ulab-b6eb80309781bd02b9b66808d29508f23881de66.zip | |
Extend instrument parts
Diffstat (limited to 'lib/libtqtrla/src')
| -rw-r--r-- | lib/libtqtrla/src/Makefile.am | 2 | ||||
| -rw-r--r-- | lib/libtqtrla/src/tqtrla.cpp | 48 | ||||
| -rw-r--r-- | lib/libtqtrla/src/tqtrla.h | 44 |
3 files changed, 93 insertions, 1 deletions
diff --git a/lib/libtqtrla/src/Makefile.am b/lib/libtqtrla/src/Makefile.am index 5c8888c..bf4c571 100644 --- a/lib/libtqtrla/src/Makefile.am +++ b/lib/libtqtrla/src/Makefile.am @@ -8,4 +8,4 @@ include_HEADERS = tqtrla.h libtqtrla_la_SOURCES = tqtrla.cpp libtqtrla_la_LIBADD = -lkio $(LIB_TDEUI) -libtqtrla_la_LDFLAGS = -avoid-version -module -no-undefined $(all_libraries)
\ No newline at end of file +libtqtrla_la_LDFLAGS = -avoid-version -module -no-undefined $(all_libraries) $(LIB_KPARTS)
\ No newline at end of file diff --git a/lib/libtqtrla/src/tqtrla.cpp b/lib/libtqtrla/src/tqtrla.cpp index 6daded3..e3001fb 100644 --- a/lib/libtqtrla/src/tqtrla.cpp +++ b/lib/libtqtrla/src/tqtrla.cpp @@ -20,6 +20,54 @@ #include "tqtrla.h" +#include <tqwidget.h> + +namespace KParts +{ + class RemoteInstrumentPartPrivate + { + public: + RemoteInstrumentPartPrivate() { + // + } + + ~RemoteInstrumentPartPrivate() { + // + } + }; + + RemoteInstrumentPart::RemoteInstrumentPart(TQObject *parent, const char *name) + : Part( parent, name ) + { + d = new RemoteInstrumentPartPrivate; + } + + RemoteInstrumentPart::~RemoteInstrumentPart() { + RemoteInstrumentPart::closeURL(); + delete d; + } + + bool RemoteInstrumentPart::openURL(const KURL &url) { + m_url = url; + return false; + } + + bool RemoteInstrumentPart::closeURL() { + return false; + } + + void RemoteInstrumentPart::close() { + TQWidget* parentWidget = dynamic_cast<TQWidget*>(parent()); + if (parentWidget) { + parentWidget->close(); + } + } + + void RemoteInstrumentPart::setStatusMessage(const TQString& message) { + emit(statusMessageSet(message)); + } +} + bool operator==( const ServiceType &s1, const ServiceType &s2 ) { bool identical = true; diff --git a/lib/libtqtrla/src/tqtrla.h b/lib/libtqtrla/src/tqtrla.h index c49c101..b43ea22 100644 --- a/lib/libtqtrla/src/tqtrla.h +++ b/lib/libtqtrla/src/tqtrla.h @@ -23,6 +23,46 @@ #include <tqobject.h> +#include <kparts/part.h> + +// ============================================================================= + +namespace KParts +{ + class RemoteInstrumentPartPrivate; + + class KPARTS_EXPORT RemoteInstrumentPart : public Part + { + Q_OBJECT + + public: + RemoteInstrumentPart(TQObject *parent = 0, const char *name = 0); + virtual ~RemoteInstrumentPart(); + + public slots: + virtual bool openURL( const KURL &url ); + + public: + KURL url() const { return m_url; } + virtual bool closeURL(); + + protected slots: + void close(); + void setStatusMessage(const TQString& message); + + signals: + void statusMessageSet(const TQString&); + + protected: + KURL m_url; + + private: + RemoteInstrumentPartPrivate *d; + }; +} + +// ============================================================================= + class ServiceType { public: @@ -42,6 +82,8 @@ typedef TQValueList<ServiceType> ServiceList; Q_EXPORT bool operator==(const ServiceType &s1, const ServiceType &s2); +// ============================================================================= + class StationType { public: @@ -59,4 +101,6 @@ Q_EXPORT TQDataStream &operator>>(TQDataStream &, StationType &); typedef TQValueList<StationType> StationList; +// ============================================================================= + #endif // TQTRLA_H
\ No newline at end of file |
