~ubuntu-branches/ubuntu/lucid/ktorrent/lucid

« back to all changes in this revision

Viewing changes to plugins/stats/ConnsTabPage.h

  • Committer: Bazaar Package Importer
  • Author(s): Richard Birnie
  • Date: 2008-06-03 20:32:46 UTC
  • mfrom: (1.1.20 upstream)
  • Revision ID: james.westby@ubuntu.com-20080603203246-dfyemn010uhsf433
Tags: 3.1~rc1+dfsg.1-1ubuntu1
* New upstream development release      
 - Dropped 01_support_external_libbtcore.diffm,
   97_fix_target_link_libraries.diff,
   99_libbtcore_scramble_soname.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright © 2007 by Krzysztof Kundzicz                                *
 
3
 *   athantor@gmail.com                                                    *
 
4
 *                                                                         *
 
5
 *   This program is free software; you can redistribute it and/or modify  *
 
6
 *   it under the terms of the GNU General Public License as published by  *
 
7
 *   the Free Software Foundation; either version 2 of the License, or     *
 
8
 *   (at your option) any later version.                                   *
 
9
 *                                                                         *
 
10
 *   This program is distributed in the hope that it will be useful,       *
 
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
13
 *   GNU General Public License for more details.                          *
 
14
 *                                                                         *
 
15
 *   You should have received a copy of the GNU General Public License     *
 
16
 *   along with this program; if not, write to the                         *
 
17
 *   Free Software Foundation, Inc.,                                       *
 
18
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.             *
 
19
 ***************************************************************************/
 
20
#ifndef ConnsTabPage_H_
 
21
#define ConnsTabPage_H_
 
22
 
 
23
#include <QWidget>
 
24
#include <QUuid>
 
25
 
 
26
#include <klocale.h>
 
27
 
 
28
#include <interfaces/plugin.h>
 
29
#include <torrent/globals.h>
 
30
#include <dht/dhtbase.h>
 
31
#include <interfaces/coreinterface.h>
 
32
#include <interfaces/torrentinterface.h>
 
33
#include <torrent/queuemanager.h>
 
34
 
 
35
#include <memory>
 
36
#include <stdint.h>
 
37
 
 
38
#include <ui_Conns.h>
 
39
 
 
40
#include <PluginPage.h>
 
41
#include <drawer/ChartDrawer.h>
 
42
#include <drawer/PlainChartDrawer.h>
 
43
#include <drawer/KPlotWgtDrawer.h>
 
44
#include <statspluginsettings.h>
 
45
 
 
46
namespace kt {
 
47
 
 
48
/** \brief Connections tab
 
49
\author Krzysztof Kundzicz <athantor@gmail.com>
 
50
*/
 
51
class ConnsTabPage : public PluginPage
 
52
{
 
53
        Q_OBJECT
 
54
 
 
55
        private:
 
56
                ///Tab's UI
 
57
                std::auto_ptr<Ui::ConnsWgt> pmConnsUi;
 
58
                
 
59
                ///Connections chart widget
 
60
                std::auto_ptr<ChartDrawer> pmConnsChtWgt;
 
61
                ///DHT chart widget
 
62
                std::auto_ptr<ChartDrawer> pmDhtChtWgt;
 
63
                
 
64
                /** \brief Leechers in swarms dataset UUID
 
65
                
 
66
                Used for identification whether this dataset is already shown on the chart and if it needs to be removed or added on settings chage
 
67
                */
 
68
                const std::auto_ptr<QUuid> pmLhrSwnUuid;
 
69
                /** \brief Seeds in swarms dataset UUID
 
70
                
 
71
                Used for identification whether this dataset is already shown on the chart and if it needs to be removed or added on settings chage
 
72
                */
 
73
                const std::auto_ptr<QUuid> pmSesSwnUuid;
 
74
                
 
75
                /** \brief Gathers data about connections
 
76
                \param  pP kt::Plugin interface
 
77
                */
 
78
                void GatherConnStats(Plugin *);
 
79
                /** \brief Gathers data about DHT
 
80
                \param  pP kt::Plugin interface
 
81
                */
 
82
                void GatherDhtStats();
 
83
                
 
84
                void SetupUi();
 
85
        public:
 
86
                /** \brief Constructor
 
87
                \param  p Parent
 
88
                */
 
89
                ConnsTabPage(QWidget * p);
 
90
                ///Destructor
 
91
                ~ConnsTabPage();
 
92
 
 
93
                
 
94
        public slots:
 
95
                void ApplySettings();
 
96
                void UpdateAllCharts();
 
97
                void GatherData(Plugin *);
 
98
                void ResetAvg(ChartDrawer *);
 
99
};
 
100
 
 
101
} // ns end
 
102
 
 
103
#endif