Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9577 in orxonox.OLD for branches/proxy/src/lib


Ignore:
Timestamp:
Jul 28, 2006, 5:40:30 PM (18 years ago)
Author:
bensch
Message:

gui in gui itself

Location:
branches/proxy/src/lib/network/monitor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/monitor/network_stats_widget.cc

    r9569 r9577  
    2323#include "shell_command.h"
    2424
    25 // SHELL_COMMAND(gui, NetworkMonitor, toggleGUI)
    26 //  ->setAlias("ProxyGui");
     25SHELL_COMMAND(gui, NetworkStatsWidget, toggleGUI)
     26->setAlias("ProxyGui");
    2727
    2828
     
    147147 */
    148148NetworkStatsWidget::NetworkStatsWidget(const NetworkMonitor* monitor)
    149   : OrxGui::GLGuiFixedpositionBox(OrxGui::Center, OrxGui::Vertical), _thisHost("myName", IP(127, 0, 0 , 1))
     149    : OrxGui::GLGuiFixedpositionBox(OrxGui::Center, OrxGui::Vertical), _thisHost("myName", IP(127, 0, 0 , 1))
    150150{
    151151  this->_monitor = monitor;
     
    173173  this->pack(&this->_thisHostIs);
    174174
    175 this->pack(&this->_thisHost);
     175  this->pack(&this->_thisHost);
    176176
    177177  this->pack(&this->_upstreamText);
     
    193193NetworkStatsWidget::~NetworkStatsWidget ()
    194194{}
     195
     196NetworkStatsWidget* NetworkStatsWidget::_statsWidget = NULL;
     197
     198#include "class_list.h"
     199
     200void NetworkStatsWidget::toggleGUI()
     201{
     202  BaseObject* bo = NULL;
     203  const std::list<BaseObject*>* ls = ClassList::getList(CL_NETWORK_MONITOR);
     204  if (ls != NULL && !ls->empty())
     205    bo = ls->front();
     206
     207  printf("==== %p\n", bo);
     208
     209  if (bo != NULL && NetworkStatsWidget::_statsWidget == NULL)
     210  {
     211    NetworkStatsWidget::_statsWidget = new NetworkStatsWidget(dynamic_cast<NetworkMonitor*> (bo));
     212    NetworkStatsWidget::_statsWidget->showAll();
     213  }
     214  else
     215  {
     216    delete NetworkStatsWidget::_statsWidget;
     217    NetworkStatsWidget::_statsWidget = NULL;
     218  }
     219}
    195220
    196221
     
    215240
    216241void NetworkStatsWidget::addProxy(const std::string& name, const IP& proxy)
    217 {
    218 }
     242{}
    219243
    220244void clearProxies();
  • branches/proxy/src/lib/network/monitor/network_stats_widget.h

    r9569 r9577  
    7474{
    7575  public:
     76    static void toggleGUI();
     77
    7678    NetworkStatsWidget(const NetworkMonitor* monitor);
    7779    virtual ~NetworkStatsWidget();
     
    116118    OrxGui::GLGuiPushButton _refreshButton;
    117119
     120    static NetworkStatsWidget*    _statsWidget;
     121
    118122    //OrxGui::GLGuiText       _valueText;
    119123    //OrxGui::GLGuiBar        _bar;
Note: See TracChangeset for help on using the changeset viewer.