mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-13 00:25:48 -04:00
Added basic PeerItems to NewsFeed for AUTH_DENIED and FAILED_CONNECTION case.
* This will need to be fixed up - but the basic logic is there! * Improved DhtWindow display of peers. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-netupgrade@4426 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
53c71daca0
commit
1cf790990f
6 changed files with 161 additions and 26 deletions
|
@ -32,7 +32,7 @@
|
|||
|
||||
#include "gui/RsAutoUpdatePage.h"
|
||||
#include "retroshare/rsdht.h"
|
||||
|
||||
#include "retroshare/rspeers.h"
|
||||
|
||||
/********************************************** STATIC WINDOW *************************************/
|
||||
DhtWindow * DhtWindow::mInstance = NULL;
|
||||
|
@ -104,6 +104,14 @@ void DhtWindow::changeEvent(QEvent *e)
|
|||
|
||||
void DhtWindow::update()
|
||||
{
|
||||
if (!isVisible())
|
||||
{
|
||||
#ifdef DEBUG_DHTWINDOW
|
||||
//std::cerr << "DhtWindow::update() !Visible" << std::endl;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
/* do nothing if locked, or not visible */
|
||||
if (RsAutoUpdatePage::eventsLocked() == true)
|
||||
{
|
||||
|
@ -113,14 +121,6 @@ void DhtWindow::update()
|
|||
return;
|
||||
}
|
||||
|
||||
if (!isVisible())
|
||||
{
|
||||
#ifdef DEBUG_DHTWINDOW
|
||||
//std::cerr << "DhtWindow::update() !Visible" << std::endl;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
if (!rsDht)
|
||||
{
|
||||
#ifdef DEBUG_DHTWINDOW
|
||||
|
@ -129,11 +129,15 @@ void DhtWindow::update()
|
|||
return;
|
||||
}
|
||||
|
||||
RsAutoUpdatePage::lockAllEvents();
|
||||
|
||||
//std::cerr << "DhtWindow::update()" << std::endl;
|
||||
updateNetStatus();
|
||||
updateNetPeers();
|
||||
updateDhtPeers();
|
||||
updateRelays();
|
||||
|
||||
RsAutoUpdatePage::unlockAllEvents() ;
|
||||
}
|
||||
|
||||
|
||||
|
@ -312,17 +316,18 @@ void DhtWindow::updateNetPeers()
|
|||
int nRelayPeers = 0;
|
||||
|
||||
|
||||
#define PTW_COL_PEERID 0
|
||||
#define PTW_COL_DHT_STATUS 1
|
||||
#define PTW_COL_RSNAME 0
|
||||
#define PTW_COL_PEERID 1
|
||||
#define PTW_COL_DHT_STATUS 2
|
||||
|
||||
#define PTW_COL_PEER_CONNECTLOGIC 2
|
||||
#define PTW_COL_PEER_CONNECTLOGIC 3
|
||||
|
||||
#define PTW_COL_PEER_CONNECT_STATUS 3
|
||||
#define PTW_COL_PEER_CONNECT_MODE 4
|
||||
#define PTW_COL_PEER_REQ_STATUS 5
|
||||
#define PTW_COL_PEER_CONNECT_STATUS 4
|
||||
#define PTW_COL_PEER_CONNECT_MODE 5
|
||||
#define PTW_COL_PEER_REQ_STATUS 6
|
||||
|
||||
#define PTW_COL_PEER_CB_MSG 6
|
||||
#define PTW_COL_RSID 7
|
||||
#define PTW_COL_PEER_CB_MSG 7
|
||||
#define PTW_COL_RSID 8
|
||||
|
||||
#if 0
|
||||
/* clear old entries */
|
||||
|
@ -375,7 +380,10 @@ void DhtWindow::updateNetPeers()
|
|||
RsDhtNetPeer status;
|
||||
rsDht->getNetPeerStatus(*it, status);
|
||||
|
||||
std::string name = rsPeers->getPeerName(*it);
|
||||
|
||||
peer_item -> setData(PTW_COL_PEERID, Qt::DisplayRole, QString::fromStdString(status.mDhtId));
|
||||
peer_item -> setData(PTW_COL_RSNAME, Qt::DisplayRole, QString::fromStdString(name));
|
||||
peer_item -> setData(PTW_COL_RSID, Qt::DisplayRole, QString::fromStdString(status.mRsId));
|
||||
|
||||
std::ostringstream dhtstate;
|
||||
|
@ -383,7 +391,7 @@ void DhtWindow::updateNetPeers()
|
|||
{
|
||||
default:
|
||||
case RSDHT_PEERDHT_NOT_ACTIVE:
|
||||
dhtstate << "Unknown";
|
||||
dhtstate << "Not Active (Maybe Connected!)";
|
||||
break;
|
||||
case RSDHT_PEERDHT_SEARCHING:
|
||||
dhtstate << "Searching";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue