mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed update notification and display in GxsTransStatistics
This commit is contained in:
parent
9853b53f8b
commit
1766087f71
@ -387,7 +387,7 @@ void p3GxsTrans::service_tick()
|
||||
|
||||
// now grab collected messages to delete
|
||||
|
||||
if(mCleanupThread != NULL && !mCleanupThread->isDone())
|
||||
if(mCleanupThread != NULL && mCleanupThread->isDone())
|
||||
{
|
||||
GxsMsgReq msgToDel ;
|
||||
|
||||
@ -543,6 +543,7 @@ void p3GxsTrans::notifyChanges(std::vector<RsGxsNotify*>& changes)
|
||||
}
|
||||
}
|
||||
}
|
||||
RsGxsIfaceHelper::receiveChanges(changes);
|
||||
}
|
||||
|
||||
uint32_t p3GxsTrans::AuthenPolicy()
|
||||
|
@ -73,7 +73,7 @@ static const int GXSTRANS_STATISTICS_DELAY_BETWEEN_GROUP_REQ = 30 ; // never req
|
||||
#define DEBUG_GXSTRANS_STATS 1
|
||||
|
||||
GxsTransportStatistics::GxsTransportStatistics(QWidget *parent)
|
||||
: RsAutoUpdatePage(2000,parent)
|
||||
: RsGxsUpdateBroadcastPage(rsGxsTrans,parent)
|
||||
{
|
||||
setupUi(this) ;
|
||||
|
||||
@ -93,6 +93,7 @@ GxsTransportStatistics::GxsTransportStatistics(QWidget *parent)
|
||||
|
||||
// load settings
|
||||
processSettings(true);
|
||||
updateDisplay(true);
|
||||
}
|
||||
|
||||
GxsTransportStatistics::~GxsTransportStatistics()
|
||||
@ -139,21 +140,16 @@ void GxsTransportStatistics::CustomPopupMenu( QPoint )
|
||||
contextMnu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void GxsTransportStatistics::updateDisplay()
|
||||
void GxsTransportStatistics::updateDisplay(bool)
|
||||
{
|
||||
time_t now = time(NULL) ;
|
||||
|
||||
if(mLastGroupReqTS + GXSTRANS_STATISTICS_DELAY_BETWEEN_GROUP_REQ < now)
|
||||
{
|
||||
std::cerr << "GxsTransportStatistics::updateDisplay()" << std::endl;
|
||||
|
||||
requestGroupMeta();
|
||||
mLastGroupReqTS = now ;
|
||||
}
|
||||
|
||||
//_tst_CW->updateContent() ;
|
||||
|
||||
updateContent();
|
||||
}
|
||||
|
||||
QString GxsTransportStatistics::getPeerName(const RsPeerId &peer_id)
|
||||
{
|
||||
static std::map<RsPeerId, QString> names ;
|
||||
@ -319,6 +315,8 @@ void GxsTransportStatistics::loadRequest(const TokenQueue *queue, const TokenReq
|
||||
std::cerr << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
updateContent();
|
||||
}
|
||||
|
||||
void GxsTransportStatistics::requestGroupMeta()
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "util/TokenQueue.h"
|
||||
#include "RsAutoUpdatePage.h"
|
||||
#include "ui_GxsTransportStatistics.h"
|
||||
#include "gui/gxs/RsGxsUpdateBroadcastPage.h"
|
||||
|
||||
class GxsTransportStatisticsWidget ;
|
||||
class UIStateHelper;
|
||||
@ -45,7 +46,7 @@ public:
|
||||
std::vector<RsMsgMetaData> messages_metas ;
|
||||
};
|
||||
|
||||
class GxsTransportStatistics: public RsAutoUpdatePage, public TokenResponse, public Ui::GxsTransportStatistics
|
||||
class GxsTransportStatistics: public RsGxsUpdateBroadcastPage, public TokenResponse, public Ui::GxsTransportStatistics
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -66,6 +67,7 @@ private slots:
|
||||
void personDetails();
|
||||
|
||||
private:
|
||||
void updateDisplay(bool complete) ;
|
||||
void loadGroupMeta(const uint32_t& token);
|
||||
void loadGroupStat(const uint32_t& token);
|
||||
void loadMsgMeta(const uint32_t& token);
|
||||
@ -77,8 +79,6 @@ private:
|
||||
void processSettings(bool bLoad);
|
||||
bool m_bProcessSettings;
|
||||
|
||||
virtual void updateDisplay() ;
|
||||
|
||||
GxsTransportStatisticsWidget *_tst_CW ;
|
||||
TokenQueue *mTransQueue ;
|
||||
UIStateHelper *mStateHelper;
|
||||
|
Loading…
Reference in New Issue
Block a user