Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 21, 2006, 12:51:19 PM (19 years ago)
Author:
bensch
Message:

much more elaborate host and proxy widgets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/util/network_stats_widget.h

    r9347 r9383  
    1717{
    1818
     19  class HostWidget : public GLGuiBox
     20  {
     21    public:
     22      HostWidget(const std::string& name, const IP& ip);
     23      ~HostWidget() {};
     24
     25      void setName(const std::string& name) { this->_name.setText(name); };
     26      void setIP(const IP& ip) { this->_ip.setText(ip.ipString()); this->_storedIP = ip; };
     27
     28      void setNameWidth(float width) { this->_name.setLineWidth(width); };
     29
     30      bool operator==(const IP& ip) const { return (this->_storedIP == ip); };
     31      bool operator==(const std::string& name) const { return (this->_name == name); };
     32
     33    protected:
     34      virtual void showing();
     35      virtual void hiding();
     36
     37    private:
     38      GLGuiText        _name;           //!< The Name of the Proxy server to be displayed.
     39      GLGuiText        _ip;             //!< The IP of the proxy server.
     40      IP               _storedIP;       //!< The ip to compare.
     41  };
     42
     43
     44  class ProxyWidget : public GLGuiBox
     45  {
     46    public:
     47      ProxyWidget(const std::string& proxyName, const IP& ip);
     48
     49      void addClient(const std::string& name, const IP& ip);
     50
     51      bool removeClient(const IP& ip);
     52      bool removeClient(const std::string& name);
     53      bool removeClient(const std::string& name, const IP& ip);
     54
     55
     56    protected:
     57      virtual void hiding();
     58      virtual void showing();
     59
     60
     61    private:
     62      HostWidget       _proxyWidget;
     63
     64      std::vector<HostWidget*>  _clients;
     65  };
     66
     67
     68
     69
    1970  //! A class to display network Statistics.
    2071  class NetworkStatsWidget : public GLGuiBox
    2172  {
     73    public:
     74      NetworkStatsWidget();
     75      virtual ~NetworkStatsWidget();
    2276
    23   public:
    24     NetworkStatsWidget();
    25     virtual ~NetworkStatsWidget();
    26 
    27     void setUpstream(unsigned int upstream);
    28     void setDownstream(unsigned int upstream);
    29     void setIP(const IP& ip);
     77      void setUpstream(unsigned int upstream);
     78      void setDownstream(unsigned int upstream);
     79      void setIP(const IP& ip);
    3080
    3181
    3282
    33     //void rebuildConnectedHosts(std::vector<hosts> hosts);
     83      //void rebuildConnectedHosts(std::vector<hosts> hosts);
    3484
    35     void setMaximum(float max);
    36     void setValue(float value);
     85      void setMaximum(float max);
     86      void setValue(float value);
    3787
    38   protected:
    39     virtual void resize();
    40     virtual void showing();
    41     virtual void hiding();
     88    protected:
     89      virtual void resize();
     90      virtual void showing();
     91      virtual void hiding();
    4292
    43   private:
    44     IP                     _ip;
    45     GLGuiText              _ipText;
     93    private:
     94      IP                     _ip;
     95      GLGuiText              _ipText;
    4696
    47     GLGuiText              _upstreamText;
    48     GLGuiText              _downstreamText;
     97      GLGuiText              _upstreamText;
     98      GLGuiText              _downstreamText;
    4999
    50     std::vector<GLGuiText> _connectedHosts;
     100      std::vector<GLGuiText> _connectedHosts;
    51101
    52     GLGuiText              _serverIP;
     102      GLGuiText              _serverIP;
    53103
    54104
    55     GLGuiText              _valueText;
    56     GLGuiBar               _bar;
     105      GLGuiText              _valueText;
     106      GLGuiBar               _bar;
    57107  };
    58108}
Note: See TracChangeset for help on using the changeset viewer.