From atlantik-devel Tue Jul 23 23:39:43 2002 From: kde () office ! kde ! org Date: Tue, 23 Jul 2002 23:39:43 +0000 To: atlantik-devel Subject: [atlantik-cvs] CVS: kdegames/atlantik/libatlantikclient atlantik_network.cpp,1.53,1.54 atlantik_netw X-MARC-Message: https://marc.info/?l=atlantik-devel&m=102746773316299 Update of /home/kde/kdegames/atlantik/libatlantikclient In directory office:/tmp/cvs-serv22616/libatlantikclient Modified Files: atlantik_network.cpp atlantik_network.h Log Message: less braindead display widgets Index: atlantik_network.cpp =================================================================== RCS file: /home/kde/kdegames/atlantik/libatlantikclient/atlantik_network.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- atlantik_network.cpp 2002/07/22 12:52:09 1.53 +++ atlantik_network.cpp 2002/07/23 23:39:41 1.54 @@ -278,12 +278,19 @@ else { emit displayText(caption, description); - for( QDomNode nButtons = n.firstChild() ; !nButtons.isNull() ; nButtons = nButtons.nextSibling() ) + + bool hasButtons = false; + for(QDomNode nButtons = n.firstChild() ; !nButtons.isNull() ; nButtons = nButtons.nextSibling() ) { QDomElement eButton = nButtons.toElement(); if (!eButton.isNull() && eButton.tagName() == "button") - emit displayButton(eButton.attributeNode(QString("command")).value(), eButton.attributeNode(QString("caption")).value(), eButton.attributeNode(QString("enabled")).value().toInt()); + { + emit addCommandButton(eButton.attributeNode(QString("command")).value(), eButton.attributeNode(QString("caption")).value(), eButton.attributeNode(QString("enabled")).value().toInt()); + hasButtons = true; + } } + if (!hasButtons) + emit addCloseButton(); } } else if (e.tagName() == "estatedisplay") @@ -299,6 +306,7 @@ { emit displayEstate(estate); + bool hasButtons = false; for( QDomNode nButtons = n.firstChild() ; !nButtons.isNull() ; nButtons = nButtons.nextSibling() ) { QDomElement eButton = nButtons.toElement(); @@ -306,9 +314,14 @@ { QDomElement eButton = nButtons.toElement(); if (!eButton.isNull() && eButton.tagName() == "button") - emit displayButton(eButton.attributeNode(QString("command")).value(), eButton.attributeNode(QString("caption")).value(), eButton.attributeNode(QString("enabled")).value().toInt()); + { + emit addCommandButton(eButton.attributeNode(QString("command")).value(), eButton.attributeNode(QString("caption")).value(), eButton.attributeNode(QString("enabled")).value().toInt()); + hasButtons = true; + } } } + if (!hasButtons) + emit addCloseButton(); } } } Index: atlantik_network.h =================================================================== RCS file: /home/kde/kdegames/atlantik/libatlantikclient/atlantik_network.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- atlantik_network.h 2002/07/21 20:10:15 1.28 +++ atlantik_network.h 2002/07/23 23:39:41 1.29 @@ -117,8 +117,9 @@ void displayText(QString title, QString description); void displayEstate(Estate *); - void displayButton(QString command, QString caption, bool enabled); void displayDefault(); + void addCommandButton(QString command, QString caption, bool enabled); + void addCloseButton(); void gameOption(QString title, QString type, QString value, QString edit, QString command); void gameListClear(); _______________________________________________ atlantik-cvs mailing list atlantik-cvs@mail.kde.org http://mail.kde.org/mailman/listinfo/atlantik-cvs