summaryrefslogtreecommitdiff
path: root/client/macro.cc
diff options
context:
space:
mode:
authorsenator <senator>2008-03-17 11:29:52 +0000
committersenator <senator>2008-03-17 11:29:52 +0000
commit96c3b5c064a26b8598943a122d9b6ecbdf1062e9 (patch)
treed7b11eaa9aa6884f014401df72fb21876c28326c /client/macro.cc
parent5c925e49369e7593a81cd199fb2791c707122cef (diff)
recent changes, dunno what exactly, but perhaps something with moving on to next dialog by clicking next
Diffstat (limited to 'client/macro.cc')
-rw-r--r--client/macro.cc34
1 files changed, 33 insertions, 1 deletions
diff --git a/client/macro.cc b/client/macro.cc
index ec520f0..654557d 100644
--- a/client/macro.cc
+++ b/client/macro.cc
@@ -28,10 +28,22 @@
#include "builder.h"
#include "sendrecieve.h"
#include <QDomDocument>
+#include <QApplication>
+
+#define MY_EVENT_ID 65432
+
+class MyEvent : public QEvent {
+public:
+ MyEvent(QString macro) : QEvent((QEvent::Type)MY_EVENT_ID)
+ {
+ this->macro = macro;
+ }
+ QString macro;
+};
static QDomDocument xml_request(QString name);
-void macro(QString name)
+void create_macro(QString name)
{
// Build the XML request
QDomDocument xml_req = xml_request(name);
@@ -55,6 +67,26 @@ void macro(QString name)
Builder *builder = new Builder(&xml_doc);
}
+bool MyEventHandler::eventFilter( QObject *o, QEvent *e )
+{
+
+ if ( e->type() == MY_EVENT_ID ) {
+ MyEvent *event = (MyEvent*)e;
+ create_macro(event->macro);
+ // ... DO SOMETHING WITH EVENT
+ return TRUE; // eat event
+ } else {
+ // standard event processing
+ return FALSE;
+ }
+}
+
+void new_macro(QString macro)
+{
+ MyEvent *event = new MyEvent(macro);
+ qApp->postEvent(qApp, event);
+}
+
static QDomDocument xml_request(QString name)
{
// Create the xml request array