2018-12-23 14:09:23 -05:00
|
|
|
/*******************************************************************************
|
|
|
|
* gui/statistics/TurtleRouterDialog.h *
|
|
|
|
* *
|
|
|
|
* Copyright (c) 2011 Retroshare Team <retroshare.project@gmail.com> *
|
|
|
|
* *
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU Affero General Public License as *
|
|
|
|
* published by the Free Software Foundation, either version 3 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 Affero General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Affero General Public License *
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
|
|
|
|
2009-08-17 03:00:34 -04:00
|
|
|
#pragma once
|
|
|
|
|
2011-05-23 17:45:25 -04:00
|
|
|
#include <retroshare/rsturtle.h>
|
2014-03-17 16:56:06 -04:00
|
|
|
#include <retroshare/rstypes.h>
|
2020-08-18 08:43:45 -04:00
|
|
|
|
|
|
|
#include <retroshare-gui/RsAutoUpdatePage.h>
|
|
|
|
|
2009-08-17 03:00:34 -04:00
|
|
|
#include "ui_TurtleRouterDialog.h"
|
2015-12-01 23:40:35 -05:00
|
|
|
#include "ui_TurtleRouterStatistics.h"
|
2009-08-17 03:00:34 -04:00
|
|
|
|
2011-05-23 17:45:25 -04:00
|
|
|
|
2010-02-14 04:06:37 -05:00
|
|
|
class TurtleRouterDialog: public RsAutoUpdatePage, public Ui::TurtleRouterDialogForm
|
2009-08-17 03:00:34 -04:00
|
|
|
{
|
2012-02-05 16:05:11 -05:00
|
|
|
Q_OBJECT
|
|
|
|
|
2009-08-17 03:00:34 -04:00
|
|
|
public:
|
2010-02-14 04:06:37 -05:00
|
|
|
TurtleRouterDialog(QWidget *parent = NULL) ;
|
2011-05-30 19:06:22 -04:00
|
|
|
~TurtleRouterDialog();
|
|
|
|
|
2011-05-23 17:45:25 -04:00
|
|
|
// Cache for peer names.
|
2014-03-17 16:56:06 -04:00
|
|
|
static QString getPeerName(const RsPeerId &peer_id) ;
|
2011-05-23 17:45:25 -04:00
|
|
|
|
2009-08-17 03:00:34 -04:00
|
|
|
private:
|
2011-05-23 17:45:25 -04:00
|
|
|
void updateTunnelRequests( const std::vector<std::vector<std::basic_string<char> > >&,
|
|
|
|
const std::vector<std::vector<std::basic_string<char> > >&,
|
2018-02-17 17:37:25 -05:00
|
|
|
const std::vector<TurtleSearchRequestDisplayInfo >&,
|
|
|
|
const std::vector<TurtleTunnelRequestDisplayInfo >&) ;
|
2011-05-30 19:06:22 -04:00
|
|
|
|
|
|
|
void processSettings(bool bLoad);
|
|
|
|
bool m_bProcessSettings;
|
2011-05-23 17:45:25 -04:00
|
|
|
|
2010-02-14 04:06:37 -05:00
|
|
|
virtual void updateDisplay() ;
|
2010-02-20 17:51:24 -05:00
|
|
|
QTreeWidgetItem *findParentHashItem(const std::string& hash) ;
|
2010-02-14 04:06:37 -05:00
|
|
|
|
2010-02-20 17:51:24 -05:00
|
|
|
std::map<std::string,QTreeWidgetItem*> top_level_hashes ;
|
|
|
|
QTreeWidgetItem *top_level_unknown_hashes ;
|
|
|
|
QTreeWidgetItem *top_level_s_requests ;
|
|
|
|
QTreeWidgetItem *top_level_t_requests ;
|
2011-05-23 17:45:25 -04:00
|
|
|
|
2009-08-17 03:00:34 -04:00
|
|
|
} ;
|
2015-11-30 21:52:15 -05:00
|
|
|
|
2018-07-15 08:40:50 -04:00
|
|
|
class TunnelStatisticsDialog: public RsAutoUpdatePage
|
2015-11-30 21:52:15 -05:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2018-07-15 08:40:50 -04:00
|
|
|
TunnelStatisticsDialog(QWidget *parent = NULL) ;
|
|
|
|
~TunnelStatisticsDialog();
|
2015-11-30 21:52:15 -05:00
|
|
|
|
|
|
|
// Cache for peer names.
|
|
|
|
static QString getPeerName(const RsPeerId &peer_id) ;
|
2018-07-15 08:40:50 -04:00
|
|
|
static QString getPeerName(const RsGxsId& gxs_id);
|
2015-11-30 21:52:15 -05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void paintEvent(QPaintEvent *);
|
|
|
|
virtual void resizeEvent(QResizeEvent *event);
|
2018-07-15 08:40:50 -04:00
|
|
|
|
|
|
|
int maxWidth ;
|
|
|
|
int maxHeight ;
|
|
|
|
|
|
|
|
QPixmap pixmap;
|
|
|
|
|
2015-11-30 21:52:15 -05:00
|
|
|
private:
|
|
|
|
void processSettings(bool bLoad);
|
|
|
|
bool m_bProcessSettings;
|
|
|
|
static QString speedString(float f);
|
|
|
|
|
2018-07-15 08:40:50 -04:00
|
|
|
virtual void updateDisplay() =0;
|
|
|
|
} ;
|
|
|
|
|
|
|
|
class GxsAuthenticatedTunnelsDialog: public TunnelStatisticsDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
GxsAuthenticatedTunnelsDialog(QWidget *parent = NULL) ;
|
|
|
|
~GxsAuthenticatedTunnelsDialog() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
virtual void updateDisplay() ;
|
|
|
|
} ;
|
|
|
|
|
|
|
|
class GxsNetTunnelsDialog: public TunnelStatisticsDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
GxsNetTunnelsDialog(QWidget *parent = NULL) ;
|
|
|
|
~GxsNetTunnelsDialog() {}
|
|
|
|
|
|
|
|
private:
|
2015-11-30 21:52:15 -05:00
|
|
|
virtual void updateDisplay() ;
|
|
|
|
} ;
|