From de8df4d55b16d13e172daa2e2f21a2bd828cdf0d Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 15 Nov 2008 22:23:16 +0000 Subject: [PATCH] added auto update feature to the trust matrix git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@807 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/TrustView.cpp | 40 ++++++++++------------------ 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/retroshare-gui/src/gui/TrustView.cpp b/retroshare-gui/src/gui/TrustView.cpp index e3cd89b6b..f3ebd2506 100644 --- a/retroshare-gui/src/gui/TrustView.cpp +++ b/retroshare-gui/src/gui/TrustView.cpp @@ -1,4 +1,5 @@ #include +#include #include #include "rsiface/rsiface.h" #include "rsiface/rspeers.h" @@ -21,6 +22,13 @@ TrustView::TrustView() QObject::connect(updatePB,SIGNAL(clicked()),this,SLOT(update())) ; QObject::connect(trustTableTW,SIGNAL(cellClicked(int,int)),this,SLOT(selectCell(int,int))) ; + updatePB->setToolTip(QString("This table normaly auto-updates every 10 seconds.")) ; + + QTimer *timer = new QTimer ; + + QObject::connect(timer,SIGNAL(timeout()),this,SLOT(update())) ; + timer->start(10000) ; + update() ; } @@ -76,7 +84,7 @@ void TrustView::updateZoom(int z) for(int i=0;irowCount();++i) trustTableTW->setRowHeight(i,row_s) ; - cout << "updated zoom" << endl; +// cout << "updated zoom" << endl; } int TrustView::getRowColId(const string& name) @@ -89,7 +97,7 @@ int TrustView::getRowColId(const string& name) if(itpr == nameToRow.end()) { i = trustTableTW->columnCount() ; - cout << " -> peer not in table. Creating entry # " << i << endl ; +// cout << " -> peer not in table. Creating entry # " << i << endl ; trustTableTW->insertColumn(i) ; trustTableTW->insertRow(i) ; @@ -123,39 +131,19 @@ void TrustView::update() RsPeerDetails details ; -#ifdef A_VIRER - // Build rows and columns - // - for(list::const_iterator it(neighs.begin()); it != neighs.end(); it++) - { - cout << "Looking for peer " << *it << endl ; - - if(!rsPeers->getPeerDetails(*it,details)) - { - cout << " -> no details" << endl ; - continue ; - } - - cout << " -> name = " << details.name << endl ; - - int i = getRowColId( details.name ) ; - - } -#endif - // Fill everything for(list::const_iterator it1(neighs.begin()); it1 != neighs.end(); ++it1) { if(!rsPeers->getPeerDetails(*it1,details)) continue ; - cout << "treating neigh = " << details.name << endl ; - cout << " signers = " ; +// cout << "treating neigh = " << details.name << endl ; +// cout << " signers = " ; int i = getRowColId(details.name) ; for(list::const_iterator it2(details.signers.begin());it2!=details.signers.end();++it2) { - cout << *it2 << " " ; +// cout << *it2 << " " ; // Signers are identified by there name, so if we have twice the same signers, this gets crappy. int j = getRowColId(*it2) ; @@ -167,7 +155,7 @@ void TrustView::update() else trustTableTW->item(i,j)->setText(trr) ; } - cout << endl ; +// cout << endl ; } // assign colors for(int i=0;irowCount();++i)