back to polygonf

git-svn-id: svn://db.shs.com.ru/pip@105 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2015-04-17 07:19:36 +00:00
parent 022b76bc29
commit 353dbedf77
25 changed files with 143 additions and 106 deletions

View File

@@ -90,6 +90,7 @@ public:
ret->content << TileList::Row("Local file manager", CellFormat());
ret->content << TileList::Row("Connect to another daemon", CellFormat());
ret->content << TileList::Row("Peer info", CellFormat());
ret->content << TileList::Row("Peer reinit", CellFormat());
ret->content << TileList::Row("Exit", CellFormat());
ret->selection_mode = TileList::NoSelection;
return ret;
@@ -136,21 +137,19 @@ public:
", " + PIString::fromNumber(cur_peer)
, CellFormat());
piForeachC(PIPeer::PeerInfo &p , daemon_.allPeers())
peers_tl->content << TileList::Row(p.name + " | " + PIString::fromNumber(p.dist) +
" | " + PIString::fromNumber(p.ping()) +
" | " + PIString::fromNumber(p.addresses.size_s()) +
" | " + PIString::fromBool(p.isNeighbour())
, CellFormat());
peers_tl->content << TileList::Row(p.name + " | d = " + PIString::fromNumber(p.dist) +
" | p = " + PIString::fromNumber(p.ping()) +
" | n = " + PIString::fromBool(p.isNeighbour())
, CellFormat());
PIPeer::PeerInfo pi = daemon_.selfInfo();
if (cur_peer >= 0 && cur_peer < daemon_.allPeers().size_s()) pi = daemon_.allPeers()[cur_peer];
peerinfo_tl->content << TileSimple::Row("Name: " + pi.name, CellFormat());
peerinfo_tl->content << TileSimple::Row("Addreses: " + PIString::fromNumber(pi.addresses.size()), CellFormat());
peerinfo_tl->content << TileSimple::Row("Neighbours: " + pi.neighbours.join(", "), CellFormat());
piForeachC(PIPeer::PeerInfo::Address &a , pi.addresses)
addrs_tl->content << TileList::Row(a.address + " | " + a.netmask +
" | " + PIString::fromNumber(a.ping) +
" | " + PIString::fromNumber(a.last_ping.toSeconds()) +
" | " + PIString::fromBool(a.isAvailable()), CellFormat());
addrs_tl->content << TileList::Row(a.address +
" | p = " + PIString::fromNumber(a.ping) +
" | a = " + PIString::fromBool(a.isAvailable()), CellFormat());
typedef PIPair<PIString, PIVector <PIPeer::PeerInfo* > > PeerPair;
PIStringList peermap;
piForeachC(PeerPair &p , daemon_._peerMap()) {
@@ -182,7 +181,8 @@ public:
case 1: tfm->show(); break;
case 2: daemon_.showMainList(); tdaemon->show(); break;
case 3: tpeer->show(); peers_tl->setFocus(); break;
case 4: PIKbdListener::exiting = true; break;
case 4: daemon_.reinit(); tmenu->show(); break;
case 5: PIKbdListener::exiting = true; break;
}
}
return;