Fix progress string on file transfer progress bar.

cusax-fix
Yana Stamcheva 17 years ago
parent 6513c807f8
commit f8d467d495

@ -274,6 +274,7 @@ service.gui.PROTOCOL=Protocol
service.gui.QUIT=&Quit
service.gui.READY=Ready
service.gui.REASON=Reason
service.gui.RECEIVED=received
service.gui.RECONNECTION_LIMIT_EXCEEDED=You have have been disconnecting and reconnecting to the server too fast. The following account: User name: {0}, Server name: {1} is temporarily banned and would have to wait a bit before trying to login again.
service.gui.REJECT=&Reject
service.gui.REMEMBER_PASSWORD=Remember password

@ -120,4 +120,14 @@ public Date getDate()
{
return new Date(fileRecord.getDate());
}
/**
* We don't have progress label in history.
*
* @return empty string
*/
protected String getProgressLabel(String bytesString)
{
return "";
}
}

@ -403,10 +403,9 @@ public void progressChanged(FileTransferProgressEvent event)
progressBar.setValue((int) event.getProgress());
ByteFormat format = new ByteFormat();
String bytesSent = format.format(
String bytesString = format.format(
event.getFileTransfer().getTransferedBytes());
progressBar.setString(bytesSent
+ " " + resources.getI18NString("service.gui.SENT"));
progressBar.setString(getProgressLabel(bytesString));
}
/**
@ -440,4 +439,12 @@ protected String getFileLabel(String fileName, long fileSize)
return fileName + " (" + text + ")";
}
/**
* Returns the label to show on the progress bar.
*
* @param bytesString the bytes that have been transfered
* @return the label to show on the progress bar
*/
protected abstract String getProgressLabel(String bytesString);
}

@ -298,4 +298,16 @@ public void finished()
}
}
}
/**
* Returns the label to show on the progress bar.
*
* @param bytesString the bytes that have been transfered
* @return the label to show on the progress bar
*/
protected String getProgressLabel(String bytesString)
{
return bytesString
+ " " + resources.getI18NString("service.gui.RECEIVED");
}
}

@ -188,4 +188,16 @@ public Date getDate()
{
return date;
}
/**
* Returns the label to show on the progress bar.
*
* @param bytesString the bytes that have been transfered
* @return the label to show on the progress bar
*/
protected String getProgressLabel(String bytesString)
{
return bytesString
+ " " + resources.getI18NString("service.gui.SENT");
}
}

Loading…
Cancel
Save