PIPeer important fix!

git-svn-id: svn://db.shs.com.ru/pip@110 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2015-04-19 19:01:46 +00:00
parent 929338a4d7
commit 476958706f
12 changed files with 147 additions and 18 deletions

View File

@@ -136,6 +136,8 @@ void Daemon::TileFileProgress::show(PIFileTransfer * f) {
if (ft) {
conn_name = ft->name();
::screen.setDialogTile(this);
label_file->content[0].first = "Preparing ...";
prog_file->value = prog_all->value = 0;
buttons->cur = 0;
buttons->setFocus();
tm.reset();
@@ -522,7 +524,7 @@ void Daemon::dataReceived(const PIString & from, const PIByteArray & data) {
r->dir_my.cd(dir);
r->ft.setDirectory(r->dir_my);
//piCout << "store to" << r->dir_my.absolutePath();
piCout << "cd to" << dir << ", abs =" << r->dir_my.absolutePath();
//piCout << "cd to" << dir << ", abs =" << r->dir_my.absolutePath();
sendDirToRemote(r);
break;
case ReplyHostInfo:

View File

@@ -52,6 +52,9 @@ public:
PIScreenTile * tile() const;
bool lockedEth() const {return eth_mutex.isLocked();}
bool lockedPeers() const {return peers_mutex.isLocked();}
private:
enum PacketType {
RequestHostInfo = 10,

View File

@@ -82,7 +82,7 @@ public:
CONNECTU(&screen, keyPressed, this, keyEvent)
CONNECTU(&file_manager, menuRequest, this, menuRequest)
CONNECTU(&daemon_, menuRequest, this, menuRequest)
start(100);
start(10);
}
PIScreenTile * menuTile() {
TileList * ret = new TileList();
@@ -127,6 +127,7 @@ public:
return ret;
}
void updatePeerInfo() {
bool pm = daemon_.lockedPeers();
screen.lock();
daemon_.lock();
peers_tl->content.clear();
@@ -134,8 +135,8 @@ public:
peerinfo_tl->content.clear();
peermap_tl->content.clear();
peers_tl->content << TileList::Row("this | 0 | 0 | " + PIString::fromNumber(daemon_.allPeers().size_s()) +
", " + PIString::fromNumber(cur_peer)
, CellFormat());
" [em = " + PIString::fromBool(daemon_.lockedEth()) + ", "
"pm = " + PIString::fromBool(pm) + "]", CellFormat());
piForeachC(PIPeer::PeerInfo &p , daemon_.allPeers())
peers_tl->content << TileList::Row(p.name + " | d = " + PIString::fromNumber(p.dist) +
" | p = " + PIString::fromNumber(p.ping()) +