try to fix vpn file transfer problems

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@12489 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Holger Bergunde
2011-06-16 09:18:27 +00:00
committed by holger.bergunde
parent 0f34c4ba2b
commit 4ea0a78a24
3 changed files with 6 additions and 2 deletions

View File

@ -261,6 +261,7 @@ public class ReceiveMessage extends JPanel {
// 100 % = Filesize
// x % = Currentsize
long p = (transfer.getAmountWritten() * 100 / transfer.getFileSize() );
System.out.println("value: "+Math.round(p));
progressBar.setValue(Math.round(p));
}

View File

@ -218,7 +218,8 @@ public class SendMessage extends JPanel {
long timediff = endtime-starttime;
long bytediff = endbyte-startbyte;
System.out.println("update bar, bytessend: "+endbyte);
updateBar(transfer, nickname, TransferUtils.calculateSpeed(bytediff, timediff) );
}
catch (InterruptedException e) {
@ -284,6 +285,7 @@ public class SendMessage extends JPanel {
showAlert(true);
}
else if (status == Status.in_progress) {
System.out.println("in progress!");
titleLabel.setText(Res.getString("message.sending.file.to", nickname));
showAlert(false);
if (!progressBar.isVisible()) {
@ -297,6 +299,7 @@ public class SendMessage extends JPanel {
// 100 % = Filesize
// x % = Currentsize
long p = (transfer.getBytesSent() * 100 / transfer.getFileSize() );
System.out.println("set value to: "+Math.round(p));
progressBar.setValue(Math.round(p));
}
});

View File

@ -73,7 +73,7 @@ public class TransferUtils {
// currentsize = timediff
// sizeleft = x
long x = sizeleft * timediff / currentsize==0?1:currentsize;
long x = sizeleft * timediff / currentsize==0l?1l:currentsize;
// Make it seconds
x = x / 1000;