summaryrefslogtreecommitdiff
path: root/client/netcom.cc
diff options
context:
space:
mode:
authordeva <deva>2009-01-15 07:24:30 +0000
committerdeva <deva>2009-01-15 07:24:30 +0000
commit4497bea2b68a883d1bed72797f27275c833843ea (patch)
treebba910d80a4384721ae6b13c64afc54735a16a98 /client/netcom.cc
parent6a81913f64590c6e49431ce483e00c8fc60573a4 (diff)
Added isDisabled method to all widget classes and made sure that only enabled widgets send their values on commit.
Diffstat (limited to 'client/netcom.cc')
-rw-r--r--client/netcom.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/client/netcom.cc b/client/netcom.cc
index b6b5bd9..18af92e 100644
--- a/client/netcom.cc
+++ b/client/netcom.cc
@@ -101,7 +101,7 @@ void NetCom::send(QVector< Widget* > widgets, QString macro, QString version)
printf("Socket state: %d\n", socket.state());
if(socket.state() != 3) printf("Socket state not connected: %s\n", socket.errorString().toStdString().c_str());
- if(qApp->activeWindow()) qApp->activeWindow()->setEnabled(false);
+ // if(qApp->activeWindow()) qApp->activeWindow()->setEnabled(false); // Moved down!
QDomDocument doc;
@@ -124,7 +124,7 @@ void NetCom::send(QVector< Widget* > widgets, QString macro, QString version)
while (i != widgets.end()) {
Widget* w = *i;
- if(!w->isDisabled()) {
+ if(!w->isDisabled() && w->getName() != "") {
QDomElement field_elem = doc.createElement("field");
field_elem.setAttribute("name", w->getName());
field_elem.setAttribute("value", w->getValue());
@@ -134,6 +134,8 @@ void NetCom::send(QVector< Widget* > widgets, QString macro, QString version)
i++;
}
+ if(qApp->activeWindow()) qApp->activeWindow()->setEnabled(false);
+
printf("\nSending commit:\n%s", doc.toString().toStdString().c_str());
socket.write(doc.toByteArray());