Changeset 9618 in orxonox.OLD
- Timestamp:
- Jul 30, 2006, 2:51:51 PM (18 years ago)
- Location:
- branches/proxy/src/lib/network/monitor
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/monitor/network_stats_widget.cc
r9607 r9618 55 55 56 56 57 ProxyWidget::ProxyWidget(const std::string& proxyName, const IP& ip)57 NodeWidget::NodeWidget(const std::string& proxyName, const IP& ip) 58 58 : _proxyWidget(proxyName, ip) 59 59 { … … 62 62 } 63 63 64 void ProxyWidget::addClient(const std::string& name, const IP& ip) 64 NodeWidget::NodeWidget(const NetworkNode* node) 65 : _proxyWidget("node", node->getPeerInfo()->ip) 66 { 67 this->_clientNameWidth = 100.0f; 68 this->pack(&_proxyWidget); 69 } 70 71 72 void NodeWidget::addClient(const std::string& name, const IP& ip) 65 73 { 66 74 HostWidget* newClient = new HostWidget(name, ip); … … 73 81 } 74 82 75 bool ProxyWidget::removeClient(const IP& ip)83 bool NodeWidget::removeClient(const IP& ip) 76 84 { 77 85 std::vector<HostWidget*>::iterator rmIt; … … 88 96 } 89 97 90 bool ProxyWidget::removeClient(const std::string& name)98 bool NodeWidget::removeClient(const std::string& name) 91 99 { 92 100 std::vector<HostWidget*>::iterator rmIt; … … 104 112 } 105 113 106 bool ProxyWidget::removeClient(const std::string& name, const IP& ip)114 bool NodeWidget::removeClient(const std::string& name, const IP& ip) 107 115 { 108 116 std::vector<HostWidget*>::iterator rmIt; … … 120 128 121 129 122 void ProxyWidget::setClientNameWidths(float width)130 void NodeWidget::setClientNameWidths(float width) 123 131 { 124 132 this->_clientNameWidth = width; … … 127 135 } 128 136 129 void ProxyWidget::hiding()137 void NodeWidget::hiding() 130 138 { 131 139 this->_proxyWidget.hide(); … … 134 142 } 135 143 136 void ProxyWidget::showing()144 void NodeWidget::showing() 137 145 { 138 146 this->_proxyWidget.show(); … … 186 194 this->_refreshButton.released.connect(this, &NetworkStatsWidget::rebuild); 187 195 this->pack(&this->_refreshButton); 196 197 this->rebuild(); 188 198 } 189 199 … … 195 205 {} 196 206 207 208 void NetworkStatsWidget::addNode(const NetworkNode* node) 209 { 210 this->_proxies.push_back(new NodeWidget(node)); 211 this->pack(this->_proxies.back()); 212 this->_proxies.back()->show(); 213 } 214 215 216 217 197 218 NetworkStatsWidget* NetworkStatsWidget::_statsWidget = NULL; 198 219 … … 255 276 256 277 278 std::list<NetworkNode*>::const_iterator it = this->_monitor->getNodeList().begin(); 279 for(; it != this->_monitor->getNodeList().end(); it++) 280 { 281 this->addNode(*it); 282 } 283 284 257 285 258 286 } -
branches/proxy/src/lib/network/monitor/network_stats_widget.h
r9607 r9618 42 42 43 43 44 class ProxyWidget : public OrxGui::GLGuiBox44 class NodeWidget : public OrxGui::GLGuiBox 45 45 { 46 46 public: 47 ProxyWidget(const std::string& proxyName, const IP& ip); 47 NodeWidget(const std::string& proxyName, const IP& ip); 48 NodeWidget(const NetworkNode* node); 48 49 49 50 void addClient(const NetworkNode* node); … … 88 89 89 90 void addProxy(const std::string& name, const IP& proxy); 91 void addNode(const NetworkNode* node); 92 90 93 void clearProxies(); 91 94 … … 115 118 OrxGui::GLGuiWidget _serverBox; 116 119 117 std::vector< HostWidget*> _proxies;120 std::vector<NodeWidget*> _proxies; 118 121 119 122
Note: See TracChangeset
for help on using the changeset viewer.