summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/rfcpopup.cpp81
-rw-r--r--noncore/net/opietooth/manager/rfcpopup.h36
2 files changed, 117 insertions, 0 deletions
diff --git a/noncore/net/opietooth/manager/rfcpopup.cpp b/noncore/net/opietooth/manager/rfcpopup.cpp
new file mode 100644
index 0000000..1b53f4b
--- a/dev/null
+++ b/noncore/net/opietooth/manager/rfcpopup.cpp
@@ -0,0 +1,81 @@
+
+#include <qtimer.h>
+
+#include "pppdialog.h"
+#include "rfcpopup.h"
+
+using namespace OpieTooth;
+
+/*
+ * c'tor init the QAction
+ */
+RfcCommPopup::RfcCommPopup()
+ : QPopupMenu() {
+ qWarning("RfcCommPopup c'tor");
+
+ QAction* a;
+
+ /* connect action */
+ a = new QAction( ); // so it's get deleted
+ a->setText("Connect");
+ a->addTo( this );
+ connect( a, SIGNAL( activated() ),
+ this, SLOT( slotConnect() ) );
+
+
+ /* disconnect action */
+ a = new QAction( );
+ a->setText("Disconnect");
+ a->addTo( this );
+ connect( a, SIGNAL( activated() ) ,
+ this, SLOT( slotDisconnect() ) );
+
+
+ /* foo action */
+ a = new QAction( );
+ a->setText("Foo");
+ a->addTo( this );
+ connect( a, SIGNAL( activated() ),
+ this, SLOT( slotFoo() ) );
+
+
+ /* bar action */
+ a = new QAction( );
+ a->setText( "Bar" );
+ a->addTo( this );
+ connect( a, SIGNAL( activated() ),
+ this, SLOT( slotBar() ) );
+
+};
+
+
+RfcCommPopup::~RfcCommPopup() {
+/* delete m_con;
+ delete m_dis;
+ delete m_foo;
+ delete m_bar; */
+}
+
+
+void RfcCommPopup::slotConnect() {
+ qWarning("connect");
+ PPPDialog pppDialog;
+ pppDialog.showMaximized();
+ pppDialog.exec();
+}
+
+
+void RfcCommPopup::slotDisconnect() {
+ qWarning("slot disconnected");
+}
+
+
+void RfcCommPopup::slotFoo() {
+ qWarning("slotFoo");
+}
+
+
+void RfcCommPopup::slotBar() {
+ qWarning("slotBar");
+};
+
diff --git a/noncore/net/opietooth/manager/rfcpopup.h b/noncore/net/opietooth/manager/rfcpopup.h
new file mode 100644
index 0000000..c388f65
--- a/dev/null
+++ b/noncore/net/opietooth/manager/rfcpopup.h
@@ -0,0 +1,36 @@
+#ifndef RFCPOPUP_H
+#define RFCPOPUP_H
+
+#include <qpopupmenu.h>
+#include <qaction.h>
+
+namespace OpieTooth {
+ /**
+ * A simple reference implementation for
+ * the popup helper factory.
+ * This class derives from QPopupMenu and uses
+ * plugged QActions to do all the nasty in it's
+ * slots. After the work is done everything must
+ * be deleted.
+ */
+ class RfcCommPopup : public QPopupMenu {
+ Q_OBJECT
+ public:
+ RfcCommPopup();
+ ~RfcCommPopup();
+
+
+ private:
+ QAction* m_con;
+ QAction* m_dis;
+ QAction* m_foo;
+ QAction* m_bar;
+ private slots:
+ void slotConnect();
+ void slotDisconnect();
+ void slotFoo();
+ void slotBar();
+ };
+};
+
+#endif