summaryrefslogtreecommitdiff
path: root/client/macro.cc
diff options
context:
space:
mode:
authorsenator <senator>2008-03-24 13:16:38 +0000
committersenator <senator>2008-03-24 13:16:38 +0000
commit2e87c4608a9fb888fd7669756d8cb457ac305f71 (patch)
tree3e8ecbf49f42bac36128a3ae24a7c76722677272 /client/macro.cc
parent885e139e750fa13a581dff70b3d8d91a9170a772 (diff)
next button now works; listbox isValid check improved; start macro implemented
Diffstat (limited to 'client/macro.cc')
-rw-r--r--client/macro.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/client/macro.cc b/client/macro.cc
index 669674b..5e3b83d 100644
--- a/client/macro.cc
+++ b/client/macro.cc
@@ -32,25 +32,24 @@
#define MY_EVENT_ID 65432
+extern QString cpr;
+extern QString user;
+
class MyEvent : public QEvent {
public:
- MyEvent(QString macro, QString cpr, QString user) : QEvent((QEvent::Type)MY_EVENT_ID)
+ MyEvent(QString macro) : QEvent((QEvent::Type)MY_EVENT_ID)
{
this->macro = macro;
- this->cpr = cpr;
- this->user = user;
}
QString macro;
- QString cpr;
- QString user;
};
-static QDomDocument xml_request(QString name, QString cpr, QString user);
+static QDomDocument xml_request(QString name);
-void create_macro(QString name, QString cpr, QString user)
+void create_macro(QString name)
{
// Build the XML request
- QDomDocument xml_req = xml_request(name, cpr, user);
+ QDomDocument xml_req = xml_request(name);
// Fetch the XML document
SendRecieve xml_acquire;
@@ -76,7 +75,7 @@ bool MyEventHandler::eventFilter( QObject *o, QEvent *e )
if ( e->type() == MY_EVENT_ID ) {
MyEvent *event = (MyEvent*)e;
- create_macro(event->macro, event->cpr, event->user);
+ create_macro(event->macro);
// ... DO SOMETHING WITH EVENT
return TRUE; // eat event
} else {
@@ -85,13 +84,15 @@ bool MyEventHandler::eventFilter( QObject *o, QEvent *e )
}
}
-void new_macro(QString macro, QString cpr, QString user)
+void new_macro(QString macro)
{
- MyEvent *event = new MyEvent(macro, cpr, user);
+ MyEvent *event = new MyEvent(macro);
qApp->postEvent(qApp, event);
+ qApp->processEvents(); /* To prevent QT from closing when
+ no windows are present */
}
-static QDomDocument xml_request(QString name, QString cpr, QString user)
+static QDomDocument xml_request(QString name)
{
// Create the xml request array
QByteArray xml_array;