Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

gui in gui itself

File:
1 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();
Note: See TracChangeset for help on using the changeset viewer.