summaryrefslogtreecommitdiffstats
path: root/plugins/stats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/stats')
-rw-r--r--plugins/stats/ChartDrawer.cpp473
-rw-r--r--plugins/stats/ChartDrawer.h286
-rw-r--r--plugins/stats/ChartDrawerData.cpp100
-rw-r--r--plugins/stats/ChartDrawerData.h123
-rw-r--r--plugins/stats/Makefile.am18
-rw-r--r--plugins/stats/PeerMonitor.cpp187
-rw-r--r--plugins/stats/PeerMonitor.h123
-rw-r--r--plugins/stats/StatsCon.cpp113
-rw-r--r--plugins/stats/StatsCon.h95
-rw-r--r--plugins/stats/StatsPluginPrefs.cpp88
-rw-r--r--plugins/stats/StatsPluginPrefs.h67
-rw-r--r--plugins/stats/StatsPluginPrefsPage.cpp29
-rw-r--r--plugins/stats/StatsPluginPrefsPage.h44
-rw-r--r--plugins/stats/StatsSpd.cpp138
-rw-r--r--plugins/stats/StatsSpd.h114
-rw-r--r--plugins/stats/ktstatsplugin.desktop24
-rw-r--r--plugins/stats/ktstatsplugin.kcfg60
-rw-r--r--plugins/stats/sprefwgt.ui517
-rw-r--r--plugins/stats/statsconwgt.ui48
-rw-r--r--plugins/stats/statsplugin.cpp321
-rw-r--r--plugins/stats/statsplugin.h154
-rw-r--r--plugins/stats/statspluginsettings.kcfgc7
-rw-r--r--plugins/stats/statsspdwgt.ui56
23 files changed, 0 insertions, 3185 deletions
diff --git a/plugins/stats/ChartDrawer.cpp b/plugins/stats/ChartDrawer.cpp
deleted file mode 100644
index 6eb08b4..0000000
--- a/plugins/stats/ChartDrawer.cpp
+++ /dev/null
@@ -1,473 +0,0 @@
-/***************************************************************************
- * Copyright © 2007 by Krzysztof Kundzicz *
- * athantor@gmail.com *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-#include "ChartDrawer.h"
-
-#ifdef USE_SOLARIS
-#include <ieeefp.h>
-int isinf(double x) { return !finite(x) && x==x; }
-#endif
-
-
-namespace kt {
-
-ChartDrawer::ChartDrawer(TQWidget *p, wgtsize_t x_max, wgtsize_t y_max, bool autom, const TQString & uname) : TQWidget(p), mXMax(x_max), mYMax(y_max), mAutoMax(autom),
- mUnitName(uname), mMMode(MaxModeExact)
-{
- setBackgroundColor("white");
-}
-
-ChartDrawer::~ChartDrawer()
-{
- TQToolTip::remove(this);
-}
-
-ChartDrawer::wgtsize_t ChartDrawer::GetXMax() const
-{
- return mXMax;
-}
-
-ChartDrawer::wgtsize_t ChartDrawer::GetYMax() const
-{
- return mYMax;
-}
-
-void ChartDrawer::SetXMax(const wgtsize_t x)
-{
- mXMax = x;
-
- for(size_t i = 0; i < mEls.size(); i++)
- {
- mEls[i].pmVals -> resize(x, 0.0);
- }
-}
-
-void ChartDrawer::SetYMax(const wgtsize_t y)
-{
- mYMax = y;
-}
-
-inline ChartDrawer::wgtsize_t ChartDrawer::GetYScale() const
-{
- return height() / 8;
-}
-
-
-inline ChartDrawer::wgtunit_t ChartDrawer::TrY(const ChartDrawer::wgtunit_t y) const
-{
- return height() - y;
-}
-
-void ChartDrawer::paintEvent ( TQPaintEvent *)
-{
- TQPainter pnt( this );
-
- DrawScale(pnt);
- DrawFrame(pnt);
- DrawChart(pnt);
-
-}
-
-inline ChartDrawer::wgtunit_t ChartDrawer::height() const
-{
- return TQWidget::height() - 15;
-}
-
-inline ChartDrawer::wgtunit_t ChartDrawer::width() const
-{
- return TQWidget::width() - 65;
-}
-
-void ChartDrawer::DrawFrame(TQPainter & rPnt )
-{
- TQPen op = rPnt.pen();
- rPnt.setPen(TQPen("#000", 3));
-
- rPnt.drawLine(0, TrY(0), width()+3, TrY(0));
- rPnt.drawLine(width()+1, TrY(0), width()+1, TrY(TQWidget::height()));
-
- TQFont oldf(rPnt.font());
- TQFont newf(oldf);
- newf.setWeight(TQFont::Bold);
- newf.setPointSize(10);
- newf.setUnderline(1);
-
- rPnt.setFont(newf);
- rPnt.drawText(width() + 30, TrY(-7), mUnitName);
- rPnt.setFont(oldf);
-
- rPnt.setPen(op);
-}
-
-void ChartDrawer::DrawScale(TQPainter & rPnt )
-{
-
- if(!mYMax)
- {
- return;
- }
-
- TQPen op = rPnt.pen();
- TQPen ep("#eee", 1, TQt::DashLine);
- TQPen lp("#666", 2, TQt::DotLine);
- TQPen tp("#000");
-
- rPnt.setPen(ep);
-
- for(wgtsize_t i = 1; i < width(); i += 10)
- {
- rPnt.drawLine(i, TrY(0), i, TrY(height()));
- }
-
- for(wgtsize_t i = 0; i < height(); i += 10)
- {
- rPnt.drawLine(0, TrY(i), width(), TrY(i));
- }
-
- rPnt.setPen(lp);
- rPnt.drawLine(0, TrY(height() - 10), width(), TrY(height() - 10));
- rPnt.setPen(tp);
- rPnt.drawText(width() + 4, TrY(height() - 10) + 4, TQString::number (mYMax));
-
- for(wgtsize_t i = 0; i < height() - 15 ; i += GetYScale())
- {
- rPnt.setPen(lp);
- rPnt.drawLine(0, TrY(i), width(), TrY(i));
- rPnt.setPen(tp);
- rPnt.drawText(width() + 4, TrY(i) + 4, TQString::number ( (mYMax / 8.0 ) * ( i / static_cast<double>(GetYScale() )), 'f', 1 ) );
- }
-
- rPnt.setPen(op);
-}
-
-void ChartDrawer::DrawChart(TQPainter & rPnt)
-{
-
- TQPen op = rPnt.pen();
-
- uint32_t skip_max = 0;
-
- for(size_t i = 0; i < mEls.size(); i++)
- {
- rPnt.setPen( *mEls[i].GetPen() );
-
- for(size_t j = 1; j < mEls[i].pmVals -> size() - 1; j++)
- {
- rPnt.drawLine(
- FindXScreenCoords(j-1),
- TrY(FindYScreenCoords(mEls[i].pmVals -> at(j-1))),
- FindXScreenCoords(j),
- TrY(FindYScreenCoords(mEls[i].pmVals -> at(j)))
- );
- }
-//
- rPnt.drawLine(
- FindXScreenCoords(mEls[i].pmVals -> size() - 2),
- TrY(FindYScreenCoords(mEls[i].pmVals -> at(mEls[i].pmVals -> size() - 2))),
- width(),
- TrY(FindYScreenCoords(mEls[i].pmVals -> at(mEls[i].pmVals -> size() - 1)))
- );
-
- // --------------------
- // Line on top
- // ------------
- TQPen myop(rPnt.pen());
- TQPen topl(myop);
- topl.setStyle(Qt::DotLine);
- rPnt.setPen(topl);
- rPnt.drawLine(0, TrY(FindYScreenCoords(mEls[i].pmVals -> at(mEls[i].pmVals -> size() - 1))), width(), TrY(FindYScreenCoords(mEls[i].pmVals -> at(mEls[i].pmVals -> size() - 1))) );
- rPnt.setPen(myop);
-
- TQFont oldf(rPnt.font());
- TQFont newf(oldf);
- newf.setWeight(TQFont::Bold);
- newf.setPointSize(8);
-
- rPnt.setFont(newf);
- rPnt.drawText(5 + (i * 50), TrY(FindYScreenCoords(mEls[i].pmVals -> at(mEls[i].pmVals -> size() - 1))) + 11, TQString::number (mEls[i].pmVals -> at(mEls[i].pmVals -> size() - 1), 'f', 2 ) );
-
-
- //------------------
- // max
- //------------------
-
- if(mMarkMax[i])
- {
- rPnt.setPen(topl);
- std::pair<double, size_t> max = mEls[i] . Max();
-
- rPnt.drawLine(
- FindXScreenCoords(max.second), TrY(0), FindXScreenCoords(max.second), TrY(height())
- );
-
- rPnt.setPen(myop);
-
- rPnt.setFont(newf);
- TQString maxv(TQString::number (max.first, 'f', 2));
-
- if(FindXScreenCoords(max.second) < 35)
- {
- rPnt.drawText(FindXScreenCoords(max.second) + 5, TrY(height() - (10 * (i - skip_max)) ) + 10, maxv ) ;
- } else {
- rPnt.drawText(FindXScreenCoords(max.second) - 35 , TrY(height() - (10 * (i - skip_max)) ) + 10, maxv ) ;
- }
- } else {
- skip_max++;
- }
-
- rPnt.setFont(oldf);
- rPnt.setPen(op);
- }
-
- rPnt.setPen(op);
-}
-
-inline ChartDrawer::wgtunit_t ChartDrawer::FindXScreenCoords(const double x) const
-{
- return static_cast<wgtunit_t>((width() / static_cast<double>(mXMax)) * x) ;
-}
-
-inline ChartDrawer::wgtunit_t ChartDrawer::FindYScreenCoords(const double y) const
-{
- return static_cast<wgtunit_t>(((height()) / static_cast<double>(mYMax)) * y) ;
-}
-
-void ChartDrawer::EnableAutoMax(bool a)
-{
- mAutoMax = a;
-}
-
-void ChartDrawer::AddValue(const size_t idx, const double val, bool u )
-{
-
- if( idx >= mEls.size() )
- {
- return;
- }
-
- ChartDrawerData::val_t::iterator it = mEls[idx].pmVals -> begin();
-
- while(it != mEls[idx] .pmVals -> end() )
- {
- *it = *(it + 1);
- it++;
- }
-
-#ifdef USE_SOLARIS
- if(isnand(val) || (isinf(val)))
-#else
- if(std::isnan(val) || (std::isinf(val)))
-#endif
- {
- *(mEls[idx].pmVals -> end() -1) = 0.0;
- } else {
- *(mEls[idx].pmVals -> end() -1) = val;
- }
-
- if(mAutoMax)
- {
- if( (mMMode == MaxModeTop) && (val > mYMax) )
- {
- mYMax = static_cast<wgtsize_t>(val) + 3;
-
- } else if(mMMode == MaxModeExact) {
- FindSetMax();
- }
- }
-
- if(u)
- {
- update();
- }
-
-}
-
-void ChartDrawer::AddValues(ChartDrawerData Cdd, const bool max)
-{
- if(Cdd.pmVals -> size() != mXMax)
- {
- Cdd.pmVals -> resize(mXMax, 0.0);
- }
-
- mEls.push_back(Cdd);
- mMarkMax.push_back(max);
-
- MakeLegendTooltip();
-}
-
-void ChartDrawer::AddValues(ChartDrawerData Cdd, const size_t idx, const bool max)
-{
- if(Cdd.pmVals -> size() != mXMax)
- {
- Cdd.pmVals -> resize(mXMax, 0.0);
- }
-
- if(idx >= mEls.size())
- {
- mEls.push_back(Cdd);
- } else {
- mEls.insert(mEls.begin() + idx, Cdd);
- }
-
- if(idx >= mMarkMax.size())
- {
- mMarkMax.push_back(max);
- } else {
- mMarkMax.insert(mMarkMax.begin() + idx, max);
- }
-
- MakeLegendTooltip();
-}
-
-void ChartDrawer::AddValuesCnt(const TQString & rN, const bool max)
-{
- mEls.push_back(ChartDrawerData(mXMax, rN));
- mMarkMax.push_back(max);
-
- MakeLegendTooltip();
-}
-
-void ChartDrawer::AddValuesCnt(const TQPen & rP, const TQString & rN, const bool max)
-{
- mEls.push_back(ChartDrawerData(rP, mXMax, rN));
- mMarkMax.push_back(max);
-
- MakeLegendTooltip();
-}
-
-void ChartDrawer::SetUnitName(const TQString & rN)
-{
- mUnitName = rN;
-}
-
-TQString ChartDrawer::GetUnitName() const
-{
- return mUnitName;
-}
-
-void ChartDrawer::mouseDoubleClickEvent ( TQMouseEvent * evt )
-{
- FindSetMax();
-
- emit DoubleClicked(evt);
-}
-
-void ChartDrawer::EnableMaxDrawAt(const size_t at, const bool e)
-{
- if(at >= mMarkMax.size())
- {
- return;
- }
-
- mMarkMax[at] = e;
-}
-
-void ChartDrawer::RemoveValuesCnt(const size_t idx)
-{
- if(idx >= mEls.size())
- {
- return;
- }
-
- mEls.erase(mEls.begin() + idx);
-
- if(idx <= mMarkMax.size())
- {
- mMarkMax.erase(mMarkMax.begin() + idx);
- }
-
- MakeLegendTooltip();
-
-}
-
-void ChartDrawer::Zero(const size_t idx)
-{
- if(idx >= mEls.size())
- {
- return;
- }
-
- std::fill(mEls[idx].pmVals -> begin(), mEls[idx].pmVals -> end(), 0.0);
-
- if(mAutoMax)
- {
- mYMax = 1;
- }
-}
-
-void ChartDrawer::MakeLegendTooltip()
-{
- TQToolTip::remove(this);
-
- TQString helpstr(TQString("<b>%1:</b><br><br>").arg(i18n("Legend")));
- TQMimeSourceFactory* factory = TQMimeSourceFactory::defaultFactory();
- std::vector<TQImage> img;
-
- for(size_t i = 0; i < mEls.size(); i++)
- {
- img.push_back(TQImage(16,16, 32));
- img[i].fill(TQColor(mEls[i].GetPen() -> color()).pixel());
-
- for(uint8_t px = 0; px < 16; px++)
- {
- img[i].setPixel(px, 0, 0); //t
- img[i].setPixel(0, px, 0); //l
- img[i].setPixel(px, 15, 0); //b
- img[i].setPixel(15, px, 0); //r
- }
-
- factory->setImage(mEls[i].GetName().replace(' ', '_') + "-" + TQString::number(i), img[i]);
- helpstr += TQString("<img src='%1'>&nbsp;&nbsp;-&nbsp;&nbsp;%2<br>").arg(mEls[i].GetName().replace(" ", "_") + "-" + TQString::number(i)).arg( mEls[i].GetName() );
- }
-
- TQToolTip::add(this, helpstr);
-}
-
-void ChartDrawer::FindSetMax()
-{
- wgtsize_t mymax = 1;
-
- for(val_t::const_iterator it = mEls.begin(); it != mEls.end(); ++it)
- {
- for(ChartDrawerData::val_t::const_iterator subit = it -> pmVals -> begin(); subit != it -> pmVals -> end(); ++subit)
- {
- if ( (*subit) > mymax )
- {
- mymax = static_cast<wgtsize_t>(*subit) + 3;
- }
- }
- }
-
- mYMax = mymax;
-}
-
-void ChartDrawer::SetMaxMode(const MaxMode mm)
-{
- mMMode = mm;
-}
-
-ChartDrawer::MaxMode ChartDrawer::GetMaxMode() const
-{
- return mMMode;
-}
-
-} //NS end
-
-#include "ChartDrawer.moc"
diff --git a/plugins/stats/ChartDrawer.h b/plugins/stats/ChartDrawer.h
deleted file mode 100644
index d7211b0..0000000
--- a/plugins/stats/ChartDrawer.h
+++ /dev/null
@@ -1,286 +0,0 @@
-/***************************************************************************
- * Copyright © 2007 by Krzysztof Kundzicz *
- * athantor@gmail.com *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-#ifndef CHARTDRAWER_H_
-#define CHARTDRAWER_H_
-
-#include <stdint.h>
-
-#include <stdint.h> //uint32_t, int64_t
-
-#include <tqwidget.h>
-#include <tqpainter.h>
-#include <tqstring.h>
-#include <tqtooltip.h>
-#include <tqmime.h>
-#include <tqimage.h>
-
-#include <tdelocale.h>
-
-#include <vector>
-#include <cmath>
-#include <algorithm> //fill
-
-#include "ChartDrawerData.h"
-
-namespace kt {
-
-/**
-\brief Widget for drawing line charts
-\author Krzysztof Kundzicz <athantor@gmail.com>
-*/
-class ChartDrawer : public TQWidget
-{
- Q_OBJECT
-
-
- public:
- ///Type used as widget size unit
- typedef uint32_t wgtsize_t;
- ///Type used as unit in chart
- typedef int64_t wgtunit_t;
- /**
- \brief Type used for data storing
- \sa ChartDrawerData
- */
- typedef std::vector<ChartDrawerData> val_t;
- ///Determines max mode
- enum MaxMode { MaxModeTop, MaxModeExact };
-
- private:
- ///Maximum X value
- wgtsize_t mXMax;
- ///Maximum Y value
- wgtsize_t mYMax;
- ///Auto maximum setting
- bool mAutoMax;
- ///Chart data
- val_t mEls;
- ///Name of the chart unit
- TQString mUnitName;
- ///Mark max
- std::vector<bool> mMarkMax;
- ///Max mode
- MaxMode mMMode;
-
- ///Paint event handler
- void paintEvent ( TQPaintEvent * );
- /**
- \brief Draws chart's frame
- \param rPnt Painter on which things will be drawn
- */
- void DrawFrame(TQPainter &rPnt);
- /**
- \brief Draws chart's scale
- \param rPnt Painter on which things will be drawn
- */
- void DrawScale(TQPainter &rPnt);
- /**
- \brief Draws chart
- \param rPnt Painter on which things will be drawn
- */
- void DrawChart(TQPainter &rPnt);
-
- /**
- \brief Gets distance between two values on OY
- \return Distance
- */
- inline wgtsize_t GetYScale() const;
-
- /**
- \brief Translates widget Y coord to cartesian
- \param y Coord
- \return Coord
- */
- inline wgtunit_t TrY(const wgtunit_t y) const;
- /**
- \brief Returns charts height
- \return Height
-
- Return only height of the chart's inside the frame — not the whole widget's
- */
- inline wgtunit_t height() const;
- /**
- \brief Returns charts width
- \return Width
-
- Return only width of the chart's inside the frame — not the whole widget's
- */
- inline wgtunit_t width() const;
-
- /**
- \brief Finds screen X coord on the widget
- \param x Coord
- \return Screen coord
- \warning Thera are rounding errors
- */
- inline wgtunit_t FindXScreenCoords(const double x) const;
- /**
- \brief Finds screen Y coord on the widget
- \param y Coord
- \return Screen coord
- \warning Thera are rounding errors
- */
- inline wgtunit_t FindYScreenCoords(const double y) const;
-
- ///Sets tooltip with legend
- void MakeLegendTooltip();
-
- public:
- /**
- \brief Widget's constructor
- \param p Parent
- \param x_max Maximum X size
- \param y_max Maximum Y size
- \param autom Whether athomagically set the maximum Y size
- \param uname Unit name
- */
- ChartDrawer(TQWidget *p = 0, wgtsize_t x_max = 2, wgtsize_t y_max = 1, bool autom = true, const TQString & uname = "KB/s");
- ~ChartDrawer();
-
- /**
- \brief Gets maximum X
- \return Maximum X
- */
- wgtsize_t GetXMax() const;
- /**
- \brief Gets maximum Y
- \return Maximum Y
- */
- wgtsize_t GetYMax() const;
-
- /**
- \brief Sets the units name
- \param rN Name
-
- \note It'l be drawn on the chart
- */
- void SetUnitName(const TQString & rN);
-
- /**
- \brief Gets unit name
- \return name
- */
- TQString GetUnitName() const;
- /**
- \brief Doubleclick handler
- \param evt Mouse event
- */
- void mouseDoubleClickEvent ( TQMouseEvent * evt );
-
- /**
- \brief Gets mode of OY axis maximum drawing
- \return mode
- */
- MaxMode GetMaxMode() const;
-
-
- public slots:
- /**
- \brief Adds value to given dataset
- \param idx Dataset index
- \param val Value to add
- \param update Whether update widget after adding
- */
- void AddValue(const size_t idx, const double val, bool update = true);
- /**
- \brief Adds dataset
- \param Cdd Dataset
- \param max Whether mark maximum of this dataset
- */
- void AddValues(ChartDrawerData Cdd, const bool max = true);
- /**
- \brief Adds dataset
- \param Cdd Dataset
- \param idx Where
- \param max Whether mark maximum of this dataset
- */
- void AddValues(ChartDrawerData Cdd, const size_t idx, const bool max = true);
- /**
- \brief Adds empty dataset
- \param rN Set's data name
- \param max Whether mark maximum of this dataset
- */
- void AddValuesCnt(const TQString & rN, const bool max = true);
- /**
- \brief Adds empty dataset
- \param rP Pen that will be used to drawing
- \param rN Dataset name
- \param max Whether mark maximum of this dataset
- */
- void AddValuesCnt(const TQPen & rP, const TQString & rN, const bool max = true );
-
- /**
- \brief Removes dataset
- \param idx Dataset index
- */
- void RemoveValuesCnt(const size_t idx);
- /**
- \brief Zeroes values
- \param idx Dataset index
- */
- void Zero(const size_t idx);
-
- ///Finds and sets maximum
- void FindSetMax();
-
- /**
- \brief Toggles marking of the maximum Y value on given dataset
- \param at dataset
- \param e Toggle?
- */
- void EnableMaxDrawAt(const size_t, const bool);
- /**
- \brief Toggles automatic max Y scale settin
- \param a Toggle?
- */
- void EnableAutoMax(bool a);
-
- /**
- \brief Sets maximum X
- \param x X size
- */
- void SetXMax(const wgtsize_t x);
- /**
- \brief Sets maximum Y
- \param y Y size
- */
- void SetYMax(const wgtsize_t x);
-
- /**
- \brief Sets mode of max of OY axis
- \param mm Mode
- */
- void SetMaxMode(const MaxMode mm);
-
-
- signals:
- /**
- \brief Emited when widget is doubleclicked
- \param evt Mouse event
- */
- void DoubleClicked(TQMouseEvent * evt);
-
-};
-
-}
-
-#endif
-
diff --git a/plugins/stats/ChartDrawerData.cpp b/plugins/stats/ChartDrawerData.cpp
deleted file mode 100644
index ba03261..0000000
--- a/plugins/stats/ChartDrawerData.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-/***************************************************************************
- * Copyright © 2007 by Krzysztof Kundzicz *
- * athantor@gmail.com *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-#include "ChartDrawerData.h"
-
-namespace kt {
-
-ChartDrawerData::ChartDrawerData(const TQString & rN) : pmQp(new TQPen("#000", 1, TQt::SolidLine)), pmVals(new val_t(2, 0.0)), mName(rN)
-{
-}
-
-ChartDrawerData::ChartDrawerData(const size_t s, const TQString & rN) : pmQp(new TQPen("#000", 1, TQt::SolidLine)), pmVals(new val_t(s, 0.0)), mName(rN)
-{
-}
-
-ChartDrawerData::ChartDrawerData(const TQPen & rQp, const TQString & rN) : pmQp(new TQPen(rQp)), pmVals(new val_t(2, 0.0)), mName(rN)
-{
-}
-
-ChartDrawerData::ChartDrawerData(const TQPen & rQp, const size_t s, const TQString & rN) : pmQp(new TQPen(rQp)), pmVals(new val_t(s, 0.0)), mName(rN)
-{
-}
-
-ChartDrawerData::ChartDrawerData(const ChartDrawerData & rS)
-{
- pmQp = new TQPen(*rS.pmQp);
- pmVals = new val_t(*rS.pmVals);
- mName = rS.mName;
-}
-
-ChartDrawerData::~ChartDrawerData()
-{
- delete pmQp;
- delete pmVals;
-}
-
-const ChartDrawerData::val_t * ChartDrawerData::GetVals() const
-{
- return pmVals;
-}
-
-const TQPen * ChartDrawerData::GetPen() const
-{
- return pmQp;
-}
-
-void ChartDrawerData::SetPen(const TQPen & rQp)
-{
- delete pmQp;
- pmQp = new TQPen(rQp);
-}
-
-std::pair<double, size_t> ChartDrawerData::Max() const
-{
-
- double max = 0.0;
- size_t cpos = 0;
- size_t maxpos = 0;
-
- for(val_t::iterator it = pmVals -> begin(); it != pmVals -> end(); it++)
- {
- if(max <= *it)
- {
- max = *it;
- maxpos = cpos;
- }
-
- cpos++;
- }
-
- return std::make_pair(max, maxpos);
-}
-
-TQString ChartDrawerData::GetName() const
-{
- return mName;
-}
-void ChartDrawerData::SetName( const TQString & rN )
-{
- mName = rN;
-}
-
-} // NS end
diff --git a/plugins/stats/ChartDrawerData.h b/plugins/stats/ChartDrawerData.h
deleted file mode 100644
index 19d16e5..0000000
--- a/plugins/stats/ChartDrawerData.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/***************************************************************************
- * Copyright © 2007 by Krzysztof Kundzicz *
- * athantor@gmail.com *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-#ifndef CHARTDRAWERDATA_H_
-#define CHARTDRAWERDATA_H_
-
-#include <tqpen.h>
-#include <vector>
-#include <map>
-
-namespace kt {
-
-class ChartDrawer;
-
-/**
-\brief Container for data used by ChartDrawer
-\author Krzysztof Kundzicz <athantor@gmail.com>
-*/
-class ChartDrawerData
-{
- friend class ChartDrawer;
-
- public:
- ///Type for stroring values
- typedef std::vector<double> val_t;
-
- private:
- ///Pen used for drawing
- TQPen * pmQp;
- ///Values
- val_t * pmVals;
- ///Name of set
- TQString mName;
-
- public:
- /**
- \brief Constructor
- \param rN Name
- */
- ChartDrawerData(const TQString & rN);
- /**
- \brief Copy constructor
- \param rS Source
- */
- ChartDrawerData(const ChartDrawerData &);
- /**
- \brief Constructor
- \param s Size
- \param rN Name
- */
- ChartDrawerData(const size_t s, const TQString & rN);
- /**
- \brief Constructor
- \param rQp Pen used for drawing
- \param rN Name
- */
- ChartDrawerData(const TQPen & rQp, const TQString & rN);
- /**
- \brief Constructor
- \param rQp Pen used for drawing
- \param s Size
- \param rN Name
- */
- ChartDrawerData(const TQPen & rQp, const size_t s, const TQString & rN);
-
- ///Destructor
- ~ChartDrawerData();
-
- /**
- \brief Gets values
- \return Pointer to values container
- */
- const val_t * GetVals() const;
- /**
- \brief Gets pen
- \return Pointer pen
- */
- const TQPen * GetPen() const;
- /**
- \brief Gets name
- \return Name
- */
- TQString GetName() const;
-
- /**
- \brief Sets pen
- \param rQp Pen
- */
- void SetPen(const TQPen & rQp);
- /**
- \brief Sets name
- \param rN Name
- */
- void SetName( const TQString & rN );
-
- /**
- \brief Finds maximum value
- \return Pair with value and position
- */
- std::pair<double, size_t> Max() const;
-
-};
-
-}
-
-#endif
diff --git a/plugins/stats/Makefile.am b/plugins/stats/Makefile.am
deleted file mode 100644
index 72d7d71..0000000
--- a/plugins/stats/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-INCLUDES = -I$(top_builddir)/libktorrent -I$(top_builddir)/ktorrent/libktorrent \
- -I$(srcdir)/../../libktorrent $(all_includes)
-
-METASOURCES = AUTO
-
-kde_module_LTLIBRARIES = ktstatsplugin.la
-
-ktstatsplugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(LIB_TDECORE) $(LIB_TDEUI) $(LIB_TDEPARTS) $(all_libraries)
-ktstatsplugin_la_SOURCES = ChartDrawerData.cpp ChartDrawer.cpp statsspdwgt.ui statsconwgt.ui StatsSpd.cpp StatsCon.cpp sprefwgt.ui statspluginsettings.kcfgc \
- StatsPluginPrefsPage.cpp StatsPluginPrefs.cpp statsplugin.cpp
-
-ktstatsplugin_la_LIBADD = $(LIB_QT) ../../libktorrent/libktorrent.la
-
-noinst_HEADERS = ChartDrawerData.h ChartDrawer.h StatsSpd.h StatsCon.h StatsPluginPrefsPage.h StatsPluginPrefs.h statsplugin.h
-
-kde_services_DATA = ktstatsplugin.desktop
-kde_kcfg_DATA = ktstatsplugin.kcfg
-KDE_CXXFLAGS = $(USE_EXCEPTIONS) $(USE_RTTI)
diff --git a/plugins/stats/PeerMonitor.cpp b/plugins/stats/PeerMonitor.cpp
deleted file mode 100644
index 083e158..0000000
--- a/plugins/stats/PeerMonitor.cpp
+++ /dev/null
@@ -1,187 +0,0 @@
-/***************************************************************************
- * Copyright © 2007 by Krzysztof Kundzicz *
- * athantor@gmail.com *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-#include "PeerMonitor.h"
-
-namespace kt {
-
-PeerMonitor::PeerMonitor(kt::TorrentInterface * pTi, std::map<bt::SHA1Hash, PeerMonitor *> * pM) : kt::MonitorInterface(), TQObject(), pmTorIface(pTi), pmPeerMMgr(pM)
-{
-
-}
-
-PeerMonitor::~PeerMonitor()
-{
-}
-
-void PeerMonitor::peerAdded (kt::PeerInterface *peer)
-{
- TQMutexLocker lock(&mtx);
-
- mPeers.push_back( peer );
-}
-
-void PeerMonitor::peerRemoved (kt::PeerInterface *peer)
-{
-
- TQMutexLocker lock(&mtx);
-
- data_t::iterator it = std::find(mPeers.begin(), mPeers.end(), peer);
-
- if(it != mPeers.end())
- {
- mPeers.erase(it);
- // *it = 0;
- }
-
-}
-
-void PeerMonitor::downloadStarted (kt::ChunkDownloadInterface *)
-{
-
-}
-
-void PeerMonitor::downloadRemoved (kt::ChunkDownloadInterface *)
-{
-
-}
-
-void PeerMonitor::stopped ()
-{
- TQMutexLocker lock(&mtx);
-
- std::fill(mPeers.begin(), mPeers.end(), static_cast<PeerInterface*>( 0 ) );
-// mPeers.clear();
-}
-
-void PeerMonitor::destroyed ()
-{
- if(pmPeerMMgr -> find(pmTorIface -> getInfoHash()) != pmPeerMMgr -> end() )
- {
- pmTorIface -> setMonitor(0);
- pmPeerMMgr -> erase(pmTorIface -> getInfoHash());
- delete this;
- }
-
-}
-
-double PeerMonitor::LeechersUpSpeed()
-{
- TQMutexLocker lock(&mtx);
-
- double spd = 0.0;
-
- //without it'll segfault/SIGABRT on stop as in meantime the iterator from
- // mPeers will be invalidated
-
- for( data_t::const_iterator it = mPeers.begin(); it != mPeers.end(); it++)
- {
- if((it != mPeers.end()) && *it && ( (*it) -> getStats().perc_of_file < 100.0) )
- {
- spd += (*it) -> getStats().download_rate;
- }
- }
-
- return spd;
-}
-
-double PeerMonitor::LeechersDownSpeed()
-{
- TQMutexLocker lock(&mtx);
-
- double spd = 0.0;
-
-
- for( data_t::const_iterator it = mPeers.begin(); it != mPeers.end(); it++)
- {
- if((it != mPeers.end()) && *it && ( (*it) -> getStats().perc_of_file < 100.0) )
- {
- spd += (*it) -> getStats().upload_rate;
- }
- }
-
- return spd;
-
-}
-
-double PeerMonitor::SeedersUpSpeed()
-{
- TQMutexLocker lock(&mtx);
-
- double spd = 0.0;
-
-
- for( data_t::const_iterator it = mPeers.begin(); it != mPeers.end(); it++)
- {
- if((it != mPeers.end()) && *it && ( (*it) -> getStats().perc_of_file == 100.0) )
- {
- spd += (*it) -> getStats().download_rate;
- }
-
- }
-
- return spd;
-
-}
-
-uint64_t PeerMonitor::GetLeechers()
-{
- TQMutexLocker lock(&mtx);
-
- uint64_t l = 0;
-
-
- for( data_t::const_iterator it = mPeers.begin(); it != mPeers.end(); it++)
- {
- if((it != mPeers.end()) && *it && ( (*it) -> getStats().perc_of_file != 100.0) )
- {
- l++;
- }
-
- }
-
- return l;
-}
-
-uint64_t PeerMonitor::GetSeeders()
-{
- TQMutexLocker lock(&mtx);
-
- uint64_t s = 0;
-
-
- for( data_t::const_iterator it = mPeers.begin(); it != mPeers.end(); it++)
- {
- if((it != mPeers.end()) && *it && ( (*it) -> getStats().perc_of_file == 100) )
- {
- s++;
- }
-
- }
-
- return s;
-}
-
-kt::TorrentInterface * PeerMonitor::GetTorIface() const
-{
- return pmTorIface;
-}
-
-} //NS end
diff --git a/plugins/stats/PeerMonitor.h b/plugins/stats/PeerMonitor.h
deleted file mode 100644
index 3489378..0000000
--- a/plugins/stats/PeerMonitor.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/***************************************************************************
- * Copyright © 2007 by Krzysztof Kundzicz *
- * athantor@gmail.com *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-#ifndef PEERMONITOR_H_
-#define PEERMONITOR_H_
-
-#include <tqmutex.h>
-
-#include <interfaces/monitorinterface.h>
-#include <interfaces/peerinterface.h>
-#include <interfaces/torrentinterface.h>
-#include <util/sha1hash.h>
-
-#include <map>
-#include <list>
-#include <algorithm>
-
-namespace kt {
-
-/**
-\brief Monitors peers
-\author Krzysztof Kundzicz <athantor@gmail.com>
-
-Used for peers statistics
-
-\warning Don't use it, as There Can Be Only One™ and the infowidgetplugin relays on it
-*/
-
-class PeerMonitor : public MonitorInterface, public TQObject
-{
- public:
- ///Type of conteiner of pointers to peers
- typedef std::list<PeerInterface *> data_t;
-
- private:
- /**
- \brief Mutex
-
- Used for locking conteiner with pointers to peers
- */
- TQMutex mtx;
- ///Container with pointers to peers
- data_t mPeers;
- ///Monitored torrent
- TorrentInterface * pmTorIface;
- /**
- \brief Pointer to PeerMonitor „manager”
-
- \li \c Key: Monitored torrent hash
- \li \c Value \c type: Pointer to peer monitor
- */
- std::map<bt::SHA1Hash, PeerMonitor *> *pmPeerMMgr;
-
- public:
- /**
- \brief Constructor
- \param pTi Pointer to monitored torrent
- \param pM Pointer to PeerMonitor „manager”
- */
- PeerMonitor(TorrentInterface * pTi, std::map<bt::SHA1Hash, PeerMonitor *> * pM);
- virtual ~PeerMonitor();
-
- virtual void peerAdded (PeerInterface *peer);
- virtual void peerRemoved (PeerInterface *peer);
- virtual void downloadStarted (ChunkDownloadInterface *cd);
- virtual void downloadRemoved (ChunkDownloadInterface *cd);
- virtual void stopped();
- virtual void destroyed () ;
-
- /**
- \brief Gets speed @ which leechers are uploading to us
- \return Speed
- */
- double LeechersUpSpeed() ;
- /**
- \brief Gets speed @ which leechers are downloading from us
- \return Speed
- */
- double LeechersDownSpeed();
- /**
- \brief Gets speed @ which seeders are uploading to us
- \return Speed
- */
- double SeedersUpSpeed() ;
- /**
- \brief Gets leechers count to which we are connected
- \return Count
- */
- uint64_t GetLeechers() ;
- /**
- \brief Gets seeders count to which we are connected
- \return Count
- */
- uint64_t GetSeeders() ;
-
- /**
- \brief Gets pointer to monitored torrent
- \return Pointer to monitored torrent
- */
- TorrentInterface * GetTorIface() const;
-
-};
-
-}
-
-#endif
diff --git a/plugins/stats/StatsCon.cpp b/plugins/stats/StatsCon.cpp
deleted file mode 100644
index 568005d..0000000
--- a/plugins/stats/StatsCon.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/***************************************************************************
- * Copyright © 2007 by Krzysztof Kundzicz *
- * athantor@gmail.com *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-#include "StatsCon.h"
-
-namespace kt {
-
-StatsCon::StatsCon(TQWidget * p) : StatsConWgt(p), pmPeersConCht(new ChartDrawer(PeersConGbw, StatsPluginSettings::connectionsMeasurements())),
- pmDHTCht(new ChartDrawer(DHTGbw, StatsPluginSettings::dHTMeasurements()))
-{
- PeersConGbw->setColumnLayout(0, Qt::Vertical );
- PeersConGbw->layout()->setSpacing( 6 );
- PeersConGbw->layout()->setMargin( 11 );
-
- pmPeersConLay = new TQVBoxLayout(PeersConGbw -> layout());
-
- DHTGbw->setColumnLayout(0, Qt::Vertical );
- DHTGbw->layout()->setSpacing( 6 );
- DHTGbw->layout()->setMargin( 11 );
-
- pmDHTLay = new TQVBoxLayout(DHTGbw -> layout());
-
- //-------------
-
- pmPeersConLay -> addWidget(pmPeersConCht);
- pmDHTLay -> addWidget(pmDHTCht);
-
- //-----------
-
- pmPeersConCht -> SetUnitName("n");
-
- pmPeersConCht -> AddValuesCnt(TQPen("#f00"), i18n("Leechers connected"));
- pmPeersConCht -> AddValuesCnt(TQPen("#900"), i18n("Leechers in swarms"));
- pmPeersConCht -> AddValuesCnt(TQPen("#00f"), i18n("Seeders connected"));
- pmPeersConCht -> AddValuesCnt(TQPen("#009"), i18n("Seeders in swarms"));
- pmPeersConCht -> AddValuesCnt(TQPen("#0a0"), i18n("Average connected leechers per torrent"));
- pmPeersConCht -> AddValuesCnt(TQPen("#060"), i18n("Average connected seeders per torrent"));
- pmPeersConCht -> AddValuesCnt(TQPen("#099"), i18n("Average connected leechers per running torrent"));
- pmPeersConCht -> AddValuesCnt(TQPen("#055"), i18n("Average connected seeders per running torrent"));
-
-
- pmDHTCht -> SetUnitName("n");
-
- pmDHTCht -> AddValuesCnt(TQPen("#f00"), i18n("Nodes"));
- pmDHTCht -> AddValuesCnt(TQPen("#00f"), i18n("Tasks"));
-}
-
-StatsCon::~StatsCon()
-{
- delete pmPeersConCht;
- delete pmDHTCht;
-
- delete pmPeersConLay;
- delete pmDHTLay;
-}
-
-void StatsCon::AddPeersConVal(const size_t idx, const double val)
-{
- pmPeersConCht -> AddValue(idx, val , false );
-}
-
-void StatsCon::AddDHTVal(const size_t idx, const double val)
-{
- pmDHTCht -> AddValue(idx, val, false);
-}
-
-void StatsCon::UpdateCharts()
-{
- pmPeersConCht -> update();
- pmDHTCht -> update();
-}
-
-void StatsCon::ZeroPeersConn(const size_t idx)
-{
- pmPeersConCht -> Zero(idx);
-}
-
-void StatsCon::ChangeConnMsmtCnt(const size_t cnt)
-{
- pmPeersConCht -> SetXMax(cnt);
-}
-
-void StatsCon::ChangeDHTMsmtCnt(const size_t cnt)
-{
- pmDHTCht -> SetXMax(cnt);
-}
-
-void StatsCon::ChangeChartsMaxMode(const ChartDrawer::MaxMode mm)
-{
- pmPeersConCht -> SetMaxMode(mm);
- pmDHTCht -> SetMaxMode(mm);
-}
-
-} //NS
-
-#include "StatsCon.moc"
diff --git a/plugins/stats/StatsCon.h b/plugins/stats/StatsCon.h
deleted file mode 100644
index 53371a2..0000000
--- a/plugins/stats/StatsCon.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/***************************************************************************
- * Copyright © 2007 by Krzysztof Kundzicz *
- * athantor@gmail.com *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-#ifndef STATSCON_H_
-#define STATSCON_H_
-
-#include <tqwidget.h>
-#include <tqlayout.h>
-#include <tqtabwidget.h>
-#include <tqgroupbox.h>
-
-#include "statspluginsettings.h"
-#include "statsconwgt.h"
-#include "ChartDrawer.h"
-
-namespace kt {
-
-class StatsCon : public StatsConWgt
-{
- Q_OBJECT
-
- private:
- ///Layout of peers connections
- TQVBoxLayout * pmPeersConLay;
- ///Layout of DHT stats
- TQVBoxLayout * pmDHTLay;
-
- ///Chart widget of peers connted
- ChartDrawer * pmPeersConCht;
- ///Chart widget of DHT
- ChartDrawer * pmDHTCht;
-
- public:
- StatsCon(TQWidget * p = 0);
- virtual ~StatsCon();
- /**
- \brief Adds value to peers connections chart
- \param idx Dataset index
- \param val Value
- */
- void AddPeersConVal(const size_t idx, const double val);
- /**
- \brief Adds value to DHT chart
- \param idx Dataset index
- \param val Value
- */
- void AddDHTVal(const size_t idx, const double val);
-
- /**
- \brief Zeroes data on given idx @ peers connections chart
- \param idx Dataset index
- */
- void ZeroPeersConn(const size_t idx);
-
- /**
- \brief Changes connections chart's measurments count
- \param cnt Measurements
- */
- void ChangeConnMsmtCnt(const size_t cnt);
- /**
- \brief Changes DHT chart's measurments count
- \param cnt Measurements
- */
- void ChangeDHTMsmtCnt(const size_t cnt);
- /**
- \brief Changes charts OY axis maximum mode
- \param mm Mode
- */
- void ChangeChartsMaxMode(const ChartDrawer::MaxMode mm);
- public slots:
- ///Updates charts
- void UpdateCharts();
-
-};
-
-} // NS
-
-#endif
diff --git a/plugins/stats/StatsPluginPrefs.cpp b/plugins/stats/StatsPluginPrefs.cpp
deleted file mode 100644
index e9becd6..0000000
--- a/plugins/stats/StatsPluginPrefs.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/***************************************************************************
- * Copyright © 2007 by Krzysztof Kundzicz *
- * athantor@gmail.com *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-#include "StatsPluginPrefs.h"
-
-namespace kt {
-
-StatsPluginPrefs::StatsPluginPrefs() : PrefPageInterface(i18n("Statistics"), i18n("Statistics options"), TDEGlobal::iconLoader()->loadIcon("ktimemon",TDEIcon::NoGroup)), pmUi(0)
-{
-}
-
-StatsPluginPrefs::~StatsPluginPrefs()
-{
-}
-
-bool StatsPluginPrefs::apply ()
-{
- StatsPluginSettings::setUpdateChartsEveryGuiUpdates(pmUi -> GuiUpdatesSbw -> value());
- StatsPluginSettings::setGatherDataEveryMs(pmUi -> DataIvalSbw -> value());
- StatsPluginSettings::setPeersSpeedDataIval(pmUi -> PeersSpdUpdIvalSbw -> value());
-
- StatsPluginSettings::setPeersSpeed(pmUi -> PeersSpdCbw -> isChecked());
- StatsPluginSettings::setDrawSeedersInSwarms(pmUi -> ConnSdrInSwaCbw -> isChecked());
- StatsPluginSettings::setDrawLeechersInSwarms(pmUi -> ConnLchInSwaCbw -> isChecked());
-
- StatsPluginSettings::setDownloadMeasurements(pmUi -> DownloadMrmtSbw -> value());
- StatsPluginSettings::setPeersSpeedMeasurements(pmUi -> PeersSpdMrmtSbw -> value());
- StatsPluginSettings::setUploadMeasurements(pmUi -> UploadMrmtSbw -> value());
- StatsPluginSettings::setConnectionsMeasurements(pmUi -> ConnsMrmtSbw -> value());
- StatsPluginSettings::setDHTMeasurements(pmUi -> DHTMrmtSbw -> value());
- StatsPluginSettings::setMaxSpdMode(pmUi -> MaxSpdModeCbw -> currentItem());
-
- StatsPluginSettings::writeConfig();
-
- emit Applied();
-
- return true;
-}
-
-void StatsPluginPrefs::createWidget (TQWidget *parent)
-{
- pmUi = new StatsPluginPrefsPage(parent);
-}
-
-void StatsPluginPrefs::updateData ()
-{
- pmUi -> GuiUpdatesSbw -> setValue(StatsPluginSettings::updateChartsEveryGuiUpdates());
- pmUi -> DataIvalSbw -> setValue(StatsPluginSettings::gatherDataEveryMs());
- pmUi -> PeersSpdUpdIvalSbw -> setValue(StatsPluginSettings::peersSpeedDataIval());
-
- pmUi -> PeersSpdCbw -> setChecked(StatsPluginSettings::peersSpeed());
- pmUi -> ConnSdrInSwaCbw -> setChecked(StatsPluginSettings::drawSeedersInSwarms());
- pmUi -> ConnLchInSwaCbw -> setChecked(StatsPluginSettings::drawLeechersInSwarms());
-
- pmUi -> DownloadMrmtSbw -> setValue(StatsPluginSettings::downloadMeasurements());
- pmUi -> PeersSpdMrmtSbw -> setValue(StatsPluginSettings::peersSpeedMeasurements());
- pmUi -> UploadMrmtSbw -> setValue(StatsPluginSettings::uploadMeasurements());
- pmUi -> ConnsMrmtSbw -> setValue(StatsPluginSettings::connectionsMeasurements());
- pmUi -> DHTMrmtSbw -> setValue(StatsPluginSettings::dHTMeasurements());
- pmUi -> MaxSpdModeCbw -> setCurrentItem(StatsPluginSettings::maxSpdMode());
-}
-
-void StatsPluginPrefs::deleteWidget ()
-{
- delete pmUi;
-}
-
-
-} //NS end
-
-#include "StatsPluginPrefs.moc"
diff --git a/plugins/stats/StatsPluginPrefs.h b/plugins/stats/StatsPluginPrefs.h
deleted file mode 100644
index 43c524d..0000000
--- a/plugins/stats/StatsPluginPrefs.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/***************************************************************************
- * Copyright © 2007 by Krzysztof Kundzicz *
- * athantor@gmail.com *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-#ifndef STATSPLUGINPREFS_H_
-#define STATSPLUGINPREFS_H_
-
-#include <tqspinbox.h>
-#include <tqcheckbox.h>
-#include <tqcombobox.h>
-
-#include <tdelocale.h>
-#include <tdeglobal.h>
-#include <kiconloader.h>
-
-#include <interfaces/prefpageinterface.h>
-
-#include "StatsPluginPrefsPage.h"
-#include "statspluginsettings.h"
-
-namespace kt {
-
-/**
-\brief Prefs page
-\author Krzysztof Kundzicz <athantor@gmail.com>
-*/
-class StatsPluginPrefs : public TQObject, public PrefPageInterface
-{
- Q_OBJECT
-
-
- private:
- ///Widget
- StatsPluginPrefsPage *pmUi;
- public:
- ///Constructor
- StatsPluginPrefs();
- ///Destructor
- virtual ~StatsPluginPrefs();
-
- virtual bool apply ();
- virtual void createWidget (TQWidget *parent);
- virtual void updateData ();
- virtual void deleteWidget ();
- signals:
- void Applied();
-};
-
-}
-
-#endif
diff --git a/plugins/stats/StatsPluginPrefsPage.cpp b/plugins/stats/StatsPluginPrefsPage.cpp
deleted file mode 100644
index e641349..0000000
--- a/plugins/stats/StatsPluginPrefsPage.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-/***************************************************************************
- * Copyright © 2007 by Krzysztof Kundzicz *
- * athantor@gmail.com *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-#include "StatsPluginPrefsPage.h"
-
-namespace kt {
-
-StatsPluginPrefsPage::StatsPluginPrefsPage(TQWidget *p) : sprefwgt(p)
-{
-}
-
-}// NS END
diff --git a/plugins/stats/StatsPluginPrefsPage.h b/plugins/stats/StatsPluginPrefsPage.h
deleted file mode 100644
index eca849f..0000000
--- a/plugins/stats/StatsPluginPrefsPage.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/***************************************************************************
- * Copyright © 2007 by Krzysztof Kundzicz *
- * athantor@gmail.com *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-#ifndef STATSPLUGINPREFSPAGE_H_
-#define STATSPLUGINPREFSPAGE_H_
-
-#include "sprefwgt.h"
-
-namespace kt {
-
-/**
-\brief Prefs widget
-\author Krzysztof Kundzicz <athantor@gmail.com>
-*/
-class StatsPluginPrefsPage : public sprefwgt
-{
- public:
- /**
- \brief Constructor
- \param p Parent
- */
- StatsPluginPrefsPage(TQWidget * p = 0);
-};
-
-}
-
-#endif
diff --git a/plugins/stats/StatsSpd.cpp b/plugins/stats/StatsSpd.cpp
deleted file mode 100644
index c8cb157..0000000
--- a/plugins/stats/StatsSpd.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-/***************************************************************************
- * Copyright © 2007 by Krzysztof Kundzicz *
- * athantor@gmail.com *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-#include "StatsSpd.h"
-
-namespace kt {
-
-StatsSpd::StatsSpd(TQWidget *p) : StatsSpdWgt(p),
- pmDownCht(new ChartDrawer(DownSpeedGbw, StatsPluginSettings::downloadMeasurements())),
- pmPeersSpdCht(new ChartDrawer(PeersSpdGbw, StatsPluginSettings::peersSpeedMeasurements())),
- pmUpCht(new ChartDrawer(UpSpeedGbw, StatsPluginSettings::uploadMeasurements()))
-{
-
- DownSpeedGbw->setColumnLayout(0, Qt::Vertical );
- DownSpeedGbw->layout()->setSpacing( 6 );
- DownSpeedGbw->layout()->setMargin( 11 );
-
- pmDSpdLay = new TQVBoxLayout(DownSpeedGbw -> layout());
-
- UpSpeedGbw->setColumnLayout(0, Qt::Vertical );
- UpSpeedGbw->layout()->setSpacing( 6 );
- UpSpeedGbw->layout()->setMargin( 11 );
-
- pmUSpdLay = new TQVBoxLayout(UpSpeedGbw -> layout());
-
- PeersSpdGbw->setColumnLayout(0, Qt::Vertical );
- PeersSpdGbw->layout()->setSpacing( 6 );
- PeersSpdGbw->layout()->setMargin( 11 );
-
- pmPeersSpdLay = new TQVBoxLayout(PeersSpdGbw -> layout());
-
- //-----------------
-
- pmUSpdLay -> addWidget(pmUpCht);
- pmDSpdLay -> addWidget(pmDownCht);
- pmPeersSpdLay -> addWidget(pmPeersSpdCht);
-
- // ----------------
-
- pmUpCht -> AddValuesCnt(TQPen("#f00"), i18n("Current"));
- pmDownCht -> AddValuesCnt(TQPen("#f00"), i18n("Current"));
-
- pmUpCht -> AddValuesCnt(TQPen("#00f"), i18n("Average"));
- pmDownCht -> AddValuesCnt(TQPen("#00f"), i18n("Average"));
-
- pmUpCht -> AddValuesCnt(i18n("Limit"), 0);
- pmDownCht -> AddValuesCnt(i18n("Limit"), 0);
-
-// pmUpCht -> AddValuesCnt(TQPen("#f0f"), i18n("Current torrent"));
-// pmDownCht -> AddValuesCnt(TQPen("#f0f"), i18n("Current torrent"));
-//
-
-
- pmPeersSpdCht -> AddValuesCnt(TQPen("#090"), i18n("Average from leecher"));
- pmPeersSpdCht -> AddValuesCnt(TQPen("#f00"), i18n("Average to leecher"));
- pmPeersSpdCht -> AddValuesCnt(TQPen("#00f"), i18n("Average from seeder"));
- pmPeersSpdCht -> AddValuesCnt(TQPen("magenta"), i18n("From leechers"));
- pmPeersSpdCht -> AddValuesCnt(TQPen("orange"), i18n("From seeders"));
-
-}
-
-StatsSpd::~StatsSpd()
-{
- delete pmUpCht;
- delete pmDownCht;
- delete pmPeersSpdCht;
-
- delete pmUSpdLay;
- delete pmDSpdLay;
- delete pmPeersSpdLay;
-
-}
-
-void StatsSpd::AddUpSpdVal(const size_t idx, const double val)
-{
- pmUpCht -> AddValue(idx, val, false);
-}
-
-void StatsSpd::AddDownSpdVal(const size_t idx, const double val)
-{
- pmDownCht -> AddValue(idx, val , false);
-}
-
-void StatsSpd::AddPeersSpdVal(const size_t idx, const double val)
-{
- pmPeersSpdCht -> AddValue(idx, val , false);
-}
-
-void StatsSpd::UpdateCharts()
-{
- pmUpCht -> update();
- pmDownCht -> update();
- pmPeersSpdCht -> update();
-}
-
-void StatsSpd::ChangeDownMsmtCnt(const size_t cnt)
-{
- pmDownCht -> SetXMax(cnt);
-}
-
-void StatsSpd::ChangePrsSpdMsmtCnt(const size_t cnt)
-{
- pmPeersSpdCht -> SetXMax(cnt);
-}
-
-void StatsSpd::ChangeUpMsmtCnt(const size_t cnt)
-{
- pmUpCht -> SetXMax(cnt);
-}
-
-void StatsSpd::ChangeChartsMaxMode(const ChartDrawer::MaxMode mm)
-{
- pmUpCht -> SetMaxMode(mm);
- pmDownCht -> SetMaxMode(mm);
- pmPeersSpdCht -> SetMaxMode(mm);
-}
-
-
-} //NS end
-
-#include "StatsSpd.moc"
diff --git a/plugins/stats/StatsSpd.h b/plugins/stats/StatsSpd.h
deleted file mode 100644
index 4f75161..0000000
--- a/plugins/stats/StatsSpd.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/***************************************************************************
- * Copyright © 2007 by Krzysztof Kundzicz *
- * athantor@gmail.com *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-#ifndef STATSSPD_H_
-#define STATSSPD_H_
-
-#include <tqwidget.h>
-#include <tqlayout.h>
-#include <tqtabwidget.h>
-#include <tqgroupbox.h>
-
-#include "statspluginsettings.h"
-#include "statsspdwgt.h"
-#include "ChartDrawer.h"
-
-namespace kt {
-
-/**
-\brief Main widget of stats plugin
-\author Krzysztof Kundzicz <athantor@gmail.com>
-*/
-class StatsSpd : public StatsSpdWgt
-{
- Q_OBJECT
-
-
- private:
- ///Layout of upload speed
- TQVBoxLayout * pmUSpdLay;
- ///Layout of down speed
- TQVBoxLayout * pmDSpdLay;
- ///Layout of peers speed
- TQVBoxLayout * pmPeersSpdLay;
-
- ///Chart widget of download speed
- ChartDrawer * pmDownCht;
- ///Chart widget of peers speed
- ChartDrawer * pmPeersSpdCht;
- ///Chart widget of upload speed
- ChartDrawer * pmUpCht;
-
- public:
- /**
- \brief Constructor
- \param p Parent
- */
- StatsSpd(TQWidget *p = 0);
- ///Destructor
- virtual ~StatsSpd();
-
- /**
- \brief Adds value to upload speed chart
- \param idx Dataset index
- \param val Value
- **/
- void AddUpSpdVal(const size_t idx, const double val);
- /**
- \brief Adds value to download speed chart
- \param idx Dataset index
- \param val Value
- **/
- void AddDownSpdVal(const size_t idx, const double val);
- /**
- \brief Adds value to peers speed chart
- \param idx Dataset index
- \param val Value
- **/
- void AddPeersSpdVal(const size_t idx, const double val);
- /**
- \brief Changes download chart's measurments count
- \param cnt Measurements
- */
- void ChangeDownMsmtCnt(const size_t cnt);
- /**
- \brief Changes peers speed chart's measurments count
- \param cnt Measurements
- */
- void ChangePrsSpdMsmtCnt(const size_t cnt);
- /**
- \brief Changes upload chart's measurments count
- \param cnt Measurements
- */
- void ChangeUpMsmtCnt(const size_t cnt);
- /**
- \brief Changes charts OY axis maximum mode
- \param mm Mode
- */
- void ChangeChartsMaxMode(const ChartDrawer::MaxMode mm);
-
- public slots:
- ///Updates charts
- void UpdateCharts();
-};
-
-}
-
-#endif
diff --git a/plugins/stats/ktstatsplugin.desktop b/plugins/stats/ktstatsplugin.desktop
deleted file mode 100644
index 21a2901..0000000
--- a/plugins/stats/ktstatsplugin.desktop
+++ /dev/null
@@ -1,24 +0,0 @@
-[Desktop Entry]
-Type=Service
-Name=StatsPlugin
-Name[bg]=Приставка за статистика
-Name[de]=Statistik-Modul
-Name[es]=Complemento de estadísticas
-Name[et]=Statistikaplugin
-Name[it]=Plugin statistiche
-Name[nds]=Statistik-Moduul
-Name[nl]=Statistiekenplugin
-Name[pl]=Wtyczka statystyk
-Name[pt]='Plugin' de Estatísticas
-Name[pt_BR]=Plugin de Estatísticas
-Name[sr]=Прикључак за статистику
-Name[sr@Latn]=Priključak za statistiku
-Name[sv]=Statistikinsticksprogram
-Name[tr]=Arama Eklentisi
-Name[uk]=Втулок статистики
-Name[xx]=xxStatsPluginxx
-Name[zh_CN]=统计插件
-Comment=
-Comment[xx]=xxxx
-X-TDE-ServiceTypes=KTorrent/Plugin
-X-TDE-Library=ktstatsplugin
diff --git a/plugins/stats/ktstatsplugin.kcfg b/plugins/stats/ktstatsplugin.kcfg
deleted file mode 100644
index 43c5dd4..0000000
--- a/plugins/stats/ktstatsplugin.kcfg
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
- http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
-
- <kcfgfile name="ktinfowidgetpluginrc"/>
- <group name="general">
- <entry name="UpdateChartsEveryGuiUpdates" type="UInt">
- <label>Update charts every</label>
- <default>4</default>
- </entry>
- <entry name="GatherDataEveryMs" type="UInt">
- <label>Gather data every</label>
- <default>1000</default>
- </entry>
- <entry name="PeersSpeed" type="Bool">
- <label>Toggle peers speed charts</label>
- <default>true</default>
- </entry>
- <entry name="PeersSpeedDataIval" type="UInt">
- <label>Interval between getting data about peers speed</label>
- <default>4</default>
- </entry>
- <entry name="DrawLeechersInSwarms" type="Bool">
- <label>Toggle drawing of leechers in swarms</label>
- <default>false</default>
- </entry>
- <entry name="DrawSeedersInSwarms" type="Bool">
- <label>Toggle drawing of seeders in swarms</label>
- <default>false</default>
- </entry>
-
- <entry name="DownloadMeasurements" type="UInt">
- <label>Download mesurments count</label>
- <default>256</default>
- </entry>
- <entry name="PeersSpeedMeasurements" type="UInt">
- <label>Peers speed mesurments count</label>
- <default>256</default>
- </entry>
- <entry name="UploadMeasurements" type="UInt">
- <label>Upload mesurments count</label>
- <default>256</default>
- </entry>
- <entry name="ConnectionsMeasurements" type="UInt">
- <label>Connections mesurments count</label>
- <default>512</default>
- </entry>
- <entry name="DHTMeasurements" type="UInt">
- <label>DHT mesurments count</label>
- <default>512</default>
- </entry>
-
- <entry name="MaxSpdMode" type="UInt">
- <label>OY axis max mode</label>
- <default>1</default>
- </entry>
- </group>
-</kcfg>
diff --git a/plugins/stats/sprefwgt.ui b/plugins/stats/sprefwgt.ui
deleted file mode 100644
index b6ce139..0000000
--- a/plugins/stats/sprefwgt.ui
+++ /dev/null
@@ -1,517 +0,0 @@
-<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
-<class>sprefwgt</class>
-<widget class="TQWidget">
- <property name="name">
- <cstring>sprefwgt</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>600</width>
- <height>480</height>
- </rect>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="spacing">
- <number>0</number>
- </property>
- <widget class="TQGroupBox">
- <property name="name">
- <cstring>groupBox1</cstring>
- </property>
- <property name="title">
- <string>Update</string>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLayoutWidget">
- <property name="name">
- <cstring>layout2</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLabel">
- <property name="name">
- <cstring>textLabel1</cstring>
- </property>
- <property name="text">
- <string>Update charts every</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>GuiUpdatesSbw</cstring>
- </property>
- </widget>
- <widget class="TQSpinBox">
- <property name="name">
- <cstring>GuiUpdatesSbw</cstring>
- </property>
- <property name="maxValue">
- <number>429496729</number>
- </property>
- <property name="minValue">
- <number>1</number>
- </property>
- <property name="value">
- <number>4</number>
- </property>
- </widget>
- <widget class="TQLabel">
- <property name="name">
- <cstring>textLabel2</cstring>
- </property>
- <property name="text">
- <string>GUI updates</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>GuiUpdatesSbw</cstring>
- </property>
- </widget>
- </hbox>
- </widget>
- <widget class="TQLayoutWidget">
- <property name="name">
- <cstring>layout4</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLabel">
- <property name="name">
- <cstring>textLabel3</cstring>
- </property>
- <property name="text">
- <string>Gather data every</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>spinBox2</cstring>
- </property>
- </widget>
- <widget class="TQSpinBox">
- <property name="name">
- <cstring>DataIvalSbw</cstring>
- </property>
- <property name="maxValue">
- <number>999999999</number>
- </property>
- <property name="minValue">
- <number>1</number>
- </property>
- <property name="lineStep">
- <number>250</number>
- </property>
- <property name="value">
- <number>1000</number>
- </property>
- </widget>
- <widget class="TQLabel">
- <property name="name">
- <cstring>textLabel4</cstring>
- </property>
- <property name="text">
- <string>miliseconds</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>spinBox2</cstring>
- </property>
- </widget>
- </hbox>
- </widget>
- </vbox>
- </widget>
- <widget class="TQGroupBox">
- <property name="name">
- <cstring>groupBox5</cstring>
- </property>
- <property name="title">
- <string>Maximum</string>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLayoutWidget">
- <property name="name">
- <cstring>layout11</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLabel">
- <property name="name">
- <cstring>textLabel1_4</cstring>
- </property>
- <property name="text">
- <string>Maximum speed scale mode:</string>
- </property>
- </widget>
- <widget class="TQComboBox">
- <item>
- <property name="text">
- <string>Top</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Exact</string>
- </property>
- </item>
- <property name="name">
- <cstring>MaxSpdModeCbw</cstring>
- </property>
- <property name="currentItem">
- <number>1</number>
- </property>
- <property name="toolTip" stdset="0">
- <string>See 'What's this' for more help</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>Set maximum value on OY scale as:
-- Top: Globally achieved maximum speed
-- Exact: Maximum achieved speed visible on chart</string>
- </property>
- </widget>
- </hbox>
- </widget>
- </vbox>
- </widget>
- <widget class="TQGroupBox">
- <property name="name">
- <cstring>groupBox3</cstring>
- </property>
- <property name="title">
- <string>Peers speed</string>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLayoutWidget">
- <property name="name">
- <cstring>layout3</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQCheckBox">
- <property name="name">
- <cstring>PeersSpdCbw</cstring>
- </property>
- <property name="text">
- <string>Peers speed:</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- <widget class="TQLabel">
- <property name="name">
- <cstring>textLabel1_2</cstring>
- </property>
- <property name="text">
- <string>update every</string>
- </property>
- </widget>
- <widget class="TQSpinBox">
- <property name="name">
- <cstring>PeersSpdUpdIvalSbw</cstring>
- </property>
- <property name="maxValue">
- <number>999999999</number>
- </property>
- <property name="minValue">
- <number>1</number>
- </property>
- <property name="value">
- <number>4</number>
- </property>
- </widget>
- <widget class="TQLabel">
- <property name="name">
- <cstring>textLabel2_2</cstring>
- </property>
- <property name="text">
- <string>chart data updates</string>
- </property>
- </widget>
- </hbox>
- </widget>
- <widget class="TQLabel">
- <property name="name">
- <cstring>textLabel3_2</cstring>
- </property>
- <property name="text">
- <string>Gathering data about many connected peers can be CPU consuming.</string>
- </property>
- <property name="alignment">
- <set>WordBreak|AlignVCenter</set>
- </property>
- </widget>
- </vbox>
- </widget>
- <widget class="TQGroupBox">
- <property name="name">
- <cstring>groupBox11</cstring>
- </property>
- <property name="title">
- <string>Peers connections</string>
- </property>
- <property name="toolTip" stdset="0">
- <string>Large values can obscure charts of connected peers</string>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLayoutWidget">
- <property name="name">
- <cstring>layout7</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQCheckBox">
- <property name="name">
- <cstring>ConnSdrInSwaCbw</cstring>
- </property>
- <property name="text">
- <string>Show seeders in swarms</string>
- </property>
- </widget>
- <widget class="TQCheckBox">
- <property name="name">
- <cstring>ConnLchInSwaCbw</cstring>
- </property>
- <property name="text">
- <string>Show leechers in swarms</string>
- </property>
- </widget>
- </hbox>
- </widget>
- </vbox>
- </widget>
- <widget class="TQGroupBox">
- <property name="name">
- <cstring>groupBox8</cstring>
- </property>
- <property name="title">
- <string>Measurements count</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLayoutWidget" row="0" column="0">
- <property name="name">
- <cstring>layout5</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLabel">
- <property name="name">
- <cstring>textLabel1_3</cstring>
- </property>
- <property name="text">
- <string>Download</string>
- </property>
- </widget>
- <widget class="TQSpinBox">
- <property name="name">
- <cstring>DownloadMrmtSbw</cstring>
- </property>
- <property name="maxValue">
- <number>999999999</number>
- </property>
- <property name="minValue">
- <number>1</number>
- </property>
- <property name="value">
- <number>256</number>
- </property>
- </widget>
- </hbox>
- </widget>
- <widget class="TQLayoutWidget" row="1" column="0">
- <property name="name">
- <cstring>layout5_2</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLabel">
- <property name="name">
- <cstring>textLabel1_3_2</cstring>
- </property>
- <property name="text">
- <string>Peers speed</string>
- </property>
- </widget>
- <widget class="TQSpinBox">
- <property name="name">
- <cstring>PeersSpdMrmtSbw</cstring>
- </property>
- <property name="maxValue">
- <number>999999999</number>
- </property>
- <property name="minValue">
- <number>1</number>
- </property>
- <property name="value">
- <number>256</number>
- </property>
- </widget>
- </hbox>
- </widget>
- <widget class="TQLayoutWidget" row="2" column="0">
- <property name="name">
- <cstring>layout5_3</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLabel">
- <property name="name">
- <cstring>textLabel1_3_3</cstring>
- </property>
- <property name="text">
- <string>Upload</string>
- </property>
- </widget>
- <widget class="TQSpinBox">
- <property name="name">
- <cstring>UploadMrmtSbw</cstring>
- </property>
- <property name="maxValue">
- <number>999999999</number>
- </property>
- <property name="minValue">
- <number>1</number>
- </property>
- <property name="value">
- <number>256</number>
- </property>
- </widget>
- </hbox>
- </widget>
- <widget class="TQLayoutWidget" row="0" column="1">
- <property name="name">
- <cstring>layout5_5</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLabel">
- <property name="name">
- <cstring>textLabel1_3_5</cstring>
- </property>
- <property name="text">
- <string>Connections</string>
- </property>
- </widget>
- <widget class="TQSpinBox">
- <property name="name">
- <cstring>ConnsMrmtSbw</cstring>
- </property>
- <property name="maxValue">
- <number>999999999</number>
- </property>
- <property name="minValue">
- <number>1</number>
- </property>
- <property name="value">
- <number>512</number>
- </property>
- </widget>
- </hbox>
- </widget>
- <widget class="TQLayoutWidget" row="1" column="1">
- <property name="name">
- <cstring>layout5_4</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLabel">
- <property name="name">
- <cstring>textLabel1_3_4</cstring>
- </property>
- <property name="text">
- <string>DHT</string>
- </property>
- </widget>
- <widget class="TQSpinBox">
- <property name="name">
- <cstring>DHTMrmtSbw</cstring>
- </property>
- <property name="maxValue">
- <number>999999999</number>
- </property>
- <property name="minValue">
- <number>1</number>
- </property>
- <property name="value">
- <number>512</number>
- </property>
- </widget>
- </hbox>
- </widget>
- </grid>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer3</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </vbox>
-</widget>
-<connections>
- <connection>
- <sender>PeersSpdCbw</sender>
- <signal>toggled(bool)</signal>
- <receiver>textLabel2_2</receiver>
- <slot>setEnabled(bool)</slot>
- </connection>
- <connection>
- <sender>PeersSpdCbw</sender>
- <signal>toggled(bool)</signal>
- <receiver>PeersSpdUpdIvalSbw</receiver>
- <slot>setEnabled(bool)</slot>
- </connection>
- <connection>
- <sender>PeersSpdCbw</sender>
- <signal>toggled(bool)</signal>
- <receiver>textLabel1_2</receiver>
- <slot>setEnabled(bool)</slot>
- </connection>
-</connections>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>
diff --git a/plugins/stats/statsconwgt.ui b/plugins/stats/statsconwgt.ui
deleted file mode 100644
index 3565a3c..0000000
--- a/plugins/stats/statsconwgt.ui
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
-<class>StatsConWgt</class>
-<widget class="TQWidget">
- <property name="name">
- <cstring>StatsConWgt</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>600</width>
- <height>480</height>
- </rect>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLayoutWidget" row="0" column="0">
- <property name="name">
- <cstring>layout3</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQGroupBox">
- <property name="name">
- <cstring>PeersConGbw</cstring>
- </property>
- <property name="title">
- <string>Peers</string>
- </property>
- </widget>
- <widget class="TQGroupBox">
- <property name="name">
- <cstring>DHTGbw</cstring>
- </property>
- <property name="title">
- <string>DHT</string>
- </property>
- </widget>
- </hbox>
- </widget>
- </grid>
-</widget>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>
diff --git a/plugins/stats/statsplugin.cpp b/plugins/stats/statsplugin.cpp
deleted file mode 100644
index 2980cb3..0000000
--- a/plugins/stats/statsplugin.cpp
+++ /dev/null
@@ -1,321 +0,0 @@
-/***************************************************************************
- * Copyright © 2007 by Krzysztof Kundzicz *
- * athantor@gmail.com *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-#include "statsplugin.h"
-
-K_EXPORT_COMPONENT_FACTORY(ktstatsplugin, KGenericFactory<kt::StatsPlugin>("ktstatsplugin"))
-
-namespace kt
-{
-
-StatsPlugin::StatsPlugin(TQObject* parent, const char* qt_name, const TQStringList& args):
- Plugin(parent, qt_name, args, "Statistics", i18n("Statistics"),"Krzysztof Kundzicz", "athantor@gmail.com", i18n("Shows transfers statistics"),"ktimemon"), pmUiSpd(0), pmUiCon(0), pmPrefsUi(0), pmUpdTmr(0)
-{
- mUpAvg = std::make_pair(0.0, 0.0);
- mDownAvg = std::make_pair(0.0, 0.0);
- mLeechAvg = std::make_pair(0, 0);
- mRunningLeechAvg = std::make_pair(0, 0);
- mSeedAvg = std::make_pair(0, 0);
- mRunningSeedAvg = std::make_pair(0, 0);
-}
-
-StatsPlugin::~StatsPlugin()
-{
-}
-
-void StatsPlugin::load()
-{
-
- mUpdCtr = 1;
- mPeerSpdUpdCtr = 1;
-
- pmUiSpd = new StatsSpd(dynamic_cast<TQWidget *>(parent()));
- pmUiCon = new StatsCon(dynamic_cast<TQWidget *>(parent()));
- pmPrefsUi = new StatsPluginPrefs();
- pmUpdTmr = new TQTimer(this);
-
- connect(pmUpdTmr, TQT_SIGNAL(timeout () ), this, TQT_SLOT(UpdateData()));
- connect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(RestartTimer()));
- connect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(TogglePeersSpdCht()));
- connect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(ToggleLchInSwmDrawing()));
- connect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(ToggleSdrInSwmDrawing()));
- connect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(ChangeMsmtsCounts()));
- connect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(ChangeMaxMode()));
-
- TogglePeersSpdCht();
- ChangeMaxMode();
-
- pmUpdTmr -> start(StatsPluginSettings::gatherDataEveryMs());
-
- getGUI() -> addToolWidget(pmUiSpd,"ktimemon" ,i18n("Speed statistics"), GUIInterface::DOCK_BOTTOM);
- getGUI() -> addToolWidget(pmUiCon,"ktimemon" ,i18n("Connection statistics"), GUIInterface::DOCK_BOTTOM);
- getGUI() -> addPrefPage (pmPrefsUi);
-
-}
-
-void StatsPlugin::unload()
-{
- getGUI() -> removeToolWidget(pmUiSpd);
- getGUI() -> removeToolWidget(pmUiCon);
- getGUI() -> removePrefPage(pmPrefsUi);
-
- disconnect(pmUpdTmr, TQT_SIGNAL(timeout()), this, TQT_SLOT(UpdateData()));
- disconnect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(RestartTimer()));
- disconnect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(TogglePeersSpdCht()));
- disconnect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(ToggleLchInSwmDrawing()));
- disconnect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(ToggleSdrInSwmDrawing()));
- disconnect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(ChangeMsmtsCounts()));
- disconnect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(ChangeMaxMode()));
-
- delete pmUiSpd;
- delete pmUiCon;
- delete pmPrefsUi;
- delete pmUpdTmr;
-}
-
-bool StatsPlugin::versionCheck(const TQString& rVer) const
-{
- return rVer == KT_VERSION_MACRO;
-}
-
-void StatsPlugin::guiUpdate()
-{
- if(mUpdCtr >= StatsPluginSettings::updateChartsEveryGuiUpdates())
- {
- pmUiSpd -> UpdateCharts();
- pmUiCon -> UpdateCharts();
- mUpdCtr = 1;
-
- } else {
- mUpdCtr++;
- }
-}
-
-void StatsPlugin::UpdateData()
-{
- uint32_t lcon = 0;
- uint32_t lswa = 0;
- uint32_t scon = 0;
- uint32_t sswa = 0;
- uint32_t rlcon = 0;
- uint32_t rlswa = 0;
- uint32_t rscon = 0;
- uint32_t rsswa = 0;
-
- uint32_t ld = 0;
- uint32_t lu = 0;
- uint32_t sd = 0;
-
- //---------------------------------------
-
- mDownAvg.first += getCore() -> getStats() . download_speed;
- mDownAvg.second++;
-
- mUpAvg.first += getCore() -> getStats() . upload_speed;
- mUpAvg.second++;
-
- pmUiSpd -> AddDownSpdVal(0, getCore() -> getStats() . download_speed / 1024.0);
- pmUiSpd -> AddUpSpdVal(0, getCore() -> getStats() . upload_speed / 1024.0);
-
- pmUiSpd -> AddDownSpdVal(1, (mDownAvg.first / mDownAvg.second) / 1024.0 );
- pmUiSpd -> AddUpSpdVal(1, (mUpAvg.first / mUpAvg.second) / 1024.0 );
-
- pmUiSpd -> AddDownSpdVal(2, getCore() -> getMaxDownloadSpeed () );
- pmUiSpd -> AddUpSpdVal(2, getCore() -> getMaxUploadSpeed ());
-
-// if(getGUI()-> getCurrentTorrent())
-// {
-// pmUi -> AddDownSpdVal(3, getGUI()-> getCurrentTorrent() -> getStats() . download_rate / 1024.0);
-// pmUi -> AddUpSpdVal(3, getGUI()-> getCurrentTorrent() -> getStats() . upload_rate / 1024.0);
-// } else {
-// pmUi -> AddDownSpdVal(3, 0.0);
-// pmUi -> AddUpSpdVal(3, 0.0);
-// }
-
- // ------
-
- bt::QueueManager::iterator tor = getCore() -> getQueueManager () -> begin();
-
- while(tor != getCore() -> getQueueManager () -> end())
- {
- lcon += (*tor) -> getStats().leechers_connected_to;
- lswa += (*tor) -> getStats().leechers_total;
- scon += (*tor) -> getStats().seeders_connected_to;
- sswa += (*tor) -> getStats().seeders_total;
-
- mLeechAvg.first += lcon;
- mLeechAvg.second += lswa;
- mSeedAvg.first += scon;
- mSeedAvg.second += sswa;
-
- if(StatsPluginSettings::peersSpeed() && ( mPeerSpdUpdCtr >= StatsPluginSettings::peersSpeedDataIval() ) )
- {
- bt::TorrentControl * tc = dynamic_cast<bt::TorrentControl *>( *tor );
- const bt::PeerManager * pm = tc->getPeerMgr();
- if(tc && pm)
- {
- for(bt::PeerManager::CItr it = pm -> beginPeerList(); it != pm -> endPeerList (); ++it)
- {
- if(it && (*it) )
- {
- if(!(*it) -> isSeeder())
- {
- ld += (*it) -> getDownloadRate();
- lu += (*it) -> getUploadRate();
- } else {
- sd += (*it) -> getDownloadRate();
- }
- }
- }
- }
- }
-
-
- if( (*tor) -> getStats().started)
- {
-
- rlcon += (*tor) -> getStats().leechers_connected_to;
- rlswa += (*tor) -> getStats().leechers_total;
- rscon += (*tor) -> getStats().seeders_connected_to;
- rsswa += (*tor) -> getStats().seeders_total;
-
- mRunningLeechAvg.first += rlcon;
- mRunningLeechAvg.second += rlswa;
- mRunningSeedAvg.first += rscon;
- mRunningSeedAvg.second += rsswa;
- }
-
- tor++;
- }
-
- // ------
-
- if(StatsPluginSettings::peersSpeed() )
- {
- if( mPeerSpdUpdCtr >= StatsPluginSettings::peersSpeedDataIval() )
- {
- pmUiSpd -> AddPeersSpdVal(0, (ld / (lcon * 1.0)) / 1024.0);
- pmUiSpd -> AddPeersSpdVal(1, (lu / (lcon * 1.0)) / 1024.0);
- pmUiSpd -> AddPeersSpdVal(2, (sd / (lswa * 1.0)) / 1024.0);
- pmUiSpd -> AddPeersSpdVal(3, ld / 1024.0);
- pmUiSpd -> AddPeersSpdVal(4, sd / 1024.0);
-
- mPeerSpdUpdCtr = 1;
- } else {
- mPeerSpdUpdCtr++;
- }
- }
-
- pmUiCon -> AddPeersConVal(0, lcon);
- if(StatsPluginSettings::drawLeechersInSwarms())
- {
- pmUiCon -> AddPeersConVal(1, lswa);
- }
- pmUiCon -> AddPeersConVal(2, scon);
- if(StatsPluginSettings::drawSeedersInSwarms())
- {
- pmUiCon -> AddPeersConVal(3, sswa);
- }
-
- double cnt = getCore() -> getQueueManager() -> count() * 1.0;
- double rcnt = getCore() -> getQueueManager() -> getNumRunning() * 1.0;
-
- pmUiCon -> AddPeersConVal(4, lcon / cnt );
- pmUiCon -> AddPeersConVal(5, scon / cnt );
- pmUiCon -> AddPeersConVal(6, lcon / rcnt);
- pmUiCon -> AddPeersConVal(7, scon / rcnt );
-
- // -----
-
- if( bt::Globals::instance().getDHT().isRunning() )
- {
- pmUiCon -> AddDHTVal(0, bt::Globals::instance().getDHT(). getStats().num_peers);
- pmUiCon -> AddDHTVal(1, bt::Globals::instance().getDHT(). getStats().num_tasks);
- }
-}
-
-void StatsPlugin::RestartTimer()
-{
- if( (!pmUpdTmr) || (!pmUpdTmr -> isActive()))
- {
- return;
- }
-
- pmUpdTmr -> stop();
- pmUpdTmr -> start(StatsPluginSettings::gatherDataEveryMs());
-}
-
-void StatsPlugin::TogglePeersSpdCht()
-{
- if(StatsPluginSettings::peersSpeed())
- {
- if(pmUiSpd -> PeersSpdGbw -> isHidden())
- {
- pmUiSpd -> PeersSpdGbw -> setHidden(false);
- }
- } else {
- if(!pmUiSpd -> PeersSpdGbw -> isHidden())
- {
- pmUiSpd -> PeersSpdGbw -> setHidden(true);
- }
- }
-}
-
-void StatsPlugin::ToggleLchInSwmDrawing()
-{
- if(!StatsPluginSettings::drawLeechersInSwarms())
- {
- pmUiCon -> ZeroPeersConn(1);
- }
-}
-
-void StatsPlugin::ToggleSdrInSwmDrawing()
-{
- if(!StatsPluginSettings::drawSeedersInSwarms())
- {
- pmUiCon -> ZeroPeersConn(3);
- }
-}
-
-void StatsPlugin::ChangeMsmtsCounts()
-{
- pmUiSpd -> ChangeDownMsmtCnt(StatsPluginSettings::downloadMeasurements());
- pmUiSpd -> ChangePrsSpdMsmtCnt(StatsPluginSettings::peersSpeedMeasurements());
- pmUiSpd -> ChangeUpMsmtCnt(StatsPluginSettings::uploadMeasurements());
- pmUiCon -> ChangeConnMsmtCnt(StatsPluginSettings::connectionsMeasurements());
- pmUiCon -> ChangeDHTMsmtCnt(StatsPluginSettings::dHTMeasurements());
-}
-
-void StatsPlugin::ChangeMaxMode()
-{
- if(StatsPluginSettings::maxSpdMode() == 0)
- {
- pmUiSpd -> ChangeChartsMaxMode(ChartDrawer::MaxModeTop);
- pmUiCon -> ChangeChartsMaxMode(ChartDrawer::MaxModeTop);
-
- } else if (StatsPluginSettings::maxSpdMode() == 1) {
- pmUiSpd -> ChangeChartsMaxMode(ChartDrawer::MaxModeExact);
- pmUiCon -> ChangeChartsMaxMode(ChartDrawer::MaxModeExact);
- }
-}
-
-} // NS end
-
-#include "statsplugin.moc"
diff --git a/plugins/stats/statsplugin.h b/plugins/stats/statsplugin.h
deleted file mode 100644
index 8cdf345..0000000
--- a/plugins/stats/statsplugin.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/***************************************************************************
- * Copyright © 2007 by Krzysztof Kundzicz *
- * athantor@gmail.com *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-#ifndef StatsPlugin_H_
-#define StatsPlugin_H_
-
-#include <kgenericfactory.h>
-
-#include <tqwidget.h>
-#include <tqtimer.h>
-
-#include <interfaces/plugin.h>
-#include <interfaces/guiinterface.h>
-#include <interfaces/coreinterface.h>
-#include <torrent/globals.h>
-#include <kademlia/dhtbase.h>
-#include <torrent/queuemanager.h>
-#include <torrent/torrentcontrol.h>
-#include <torrent/peermanager.h>
-#include <torrent/peer.h>
-
-#include "StatsSpd.h"
-#include "StatsCon.h"
-#include "StatsPluginPrefs.h"
-#include "statspluginsettings.h"
-#include <map> // std::pair
-
-namespace kt {
-
-/**
-\brief Statistics plugin
-\author Krzysztof Kundzicz <athantor@gmail.com>
-\version 200705191548
-*/
-class StatsPlugin : public Plugin
-{
- Q_OBJECT
-
-
- private:
- ///Speed UI of the plugin
- StatsSpd * pmUiSpd;
- ///Connections UI of the plugin
- StatsCon * pmUiCon;
- ///UI of the pref page
- StatsPluginPrefs * pmPrefsUi;
- /**
- \brief Average upload speed data
-
- \li \c first: Total speed
- \li \c second: Measurements count
- */
- std::pair<long double, long double> mUpAvg;
- /**
- \brief Average download speed data
-
- \li \c first: Total speed
- \li \c second: Measurements count
- */
- std::pair<long double, long double> mDownAvg;
- /**
- \brief Leechers stats
-
- \li \c first: connected
- \li \c second: swarm
- */
- std::pair<uint32_t, uint32_t> mLeechAvg;
- /**
- \brief Leechers stats on running torrents
-
- \li \c first: connected
- \li \c second: swarm
- */
- std::pair<uint32_t, uint32_t> mRunningLeechAvg;
- /**
- \brief Seeders stats
-
- \li \c first: connected
- \li \c second: swarm
- */
- std::pair<uint32_t, uint32_t> mSeedAvg;
- /**
- \brief Seeders stats on running torrents
-
- \li \c first: connected
- \li \c second: swarm
- */
- std::pair<uint32_t, uint32_t> mRunningSeedAvg;
-
- ///Data update timer
- TQTimer * pmUpdTmr;
-
- ///Update ctr
- uint32_t mUpdCtr;
- uint32_t mPeerSpdUpdCtr;
-
- private slots:
- ///Updates stat data
- void UpdateData();
- /**
- \brief Restarts timer
-
- Restarts timer when the interval of data gathering has been changed
- */
- void RestartTimer();
- ///Toggles peers speed chart
- void TogglePeersSpdCht();
- ///Toggles drawing of total leechers in swarms
- void ToggleLchInSwmDrawing();
- ///Toggles drawing of total seeders in swarms
- void ToggleSdrInSwmDrawing();
- ///Changes measurements counts
- void ChangeMsmtsCounts();
- ///Changes OY max mode
- void ChangeMaxMode();
-
- public:
- /**
- \brief Constructor
- \param parent Parent
- \param qt_name
- \param args
- */
- StatsPlugin(TQObject* parent, const char* qt_name, const TQStringList& args);
- ///Destructor
- virtual ~StatsPlugin();
-
- virtual void load();
- virtual void unload();
- virtual bool versionCheck(const TQString&) const;
- virtual void guiUpdate();
-};
-
-}
-
-#endif
-
diff --git a/plugins/stats/statspluginsettings.kcfgc b/plugins/stats/statspluginsettings.kcfgc
deleted file mode 100644
index 034322e..0000000
--- a/plugins/stats/statspluginsettings.kcfgc
+++ /dev/null
@@ -1,7 +0,0 @@
-# Code generation options for tdeconfig_compiler
-File=ktstatsplugin.kcfg
-ClassName=StatsPluginSettings
-Namespace=kt
-Singleton=true
-Mutators=true
-# will create the necessary code for setting those variables
diff --git a/plugins/stats/statsspdwgt.ui b/plugins/stats/statsspdwgt.ui
deleted file mode 100644
index b04e19a..0000000
--- a/plugins/stats/statsspdwgt.ui
+++ /dev/null
@@ -1,56 +0,0 @@
-<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
-<class>StatsSpdWgt</class>
-<widget class="TQWidget">
- <property name="name">
- <cstring>StatsSpdWgt</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>600</width>
- <height>480</height>
- </rect>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLayoutWidget" row="0" column="0">
- <property name="name">
- <cstring>layout5</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQGroupBox">
- <property name="name">
- <cstring>DownSpeedGbw</cstring>
- </property>
- <property name="title">
- <string>Download</string>
- </property>
- </widget>
- <widget class="TQGroupBox">
- <property name="name">
- <cstring>PeersSpdGbw</cstring>
- </property>
- <property name="title">
- <string>Peers</string>
- </property>
- </widget>
- <widget class="TQGroupBox">
- <property name="name">
- <cstring>UpSpeedGbw</cstring>
- </property>
- <property name="title">
- <string>Upload</string>
- </property>
- </widget>
- </hbox>
- </widget>
- </grid>
-</widget>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>