diff options
author | Matti Airas <matti.p.airas@nokia.com> | 2010-08-27 18:41:32 +0300 |
---|---|---|
committer | Matti Airas <matti.p.airas@nokia.com> | 2010-09-02 16:30:33 +0300 |
commit | 9ad3bd1f9616d18f7458b676bc373c65072800f4 (patch) | |
tree | 623eb2c8cbc98732508a253a41b5952af3eaf837 /examples/network | |
parent | b9952a833791d12256c1f2b7d0ac157cdf7aa7f6 (diff) |
fixed loopback.py
Diffstat (limited to 'examples/network')
-rwxr-xr-x | examples/network/loopback.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/network/loopback.py b/examples/network/loopback.py index 8deab9f..88a29d2 100755 --- a/examples/network/loopback.py +++ b/examples/network/loopback.py @@ -86,8 +86,8 @@ class Dialog(QtGui.QDialog): while not self.tcpServer.isListening() and not self.tcpServer.listen(): ret = QtGui.QMessageBox.critical(self, self.tr("Loopback"), - self.tr("Unable to start the test: %1.").arg( - self.tcpServer.errorString()), + self.tr("Unable to start the test: %(error)s.") % { + 'error': self.tcpServer.errorString()}, QtGui.QMessageBox.Retry, QtGui.QMessageBox.Cancel) if ret == QtGui.QMessageBox.Cancel: @@ -119,8 +119,8 @@ class Dialog(QtGui.QDialog): self.serverProgressBar.setMaximum(Dialog.TotalBytes) self.serverProgressBar.setValue(self.bytesReceived) - self.serverStatusLabel.setText(self.tr("Received %1MB") - .arg(self.bytesReceived / (1024 * 1024))) + self.serverStatusLabel.setText(self.tr("Received %(rec)d MiB") + % {'rec': self.bytesReceived / (1024 * 1024)}) if self.bytesReceived == Dialog.TotalBytes: self.tcpServerConnection.close() @@ -135,8 +135,8 @@ class Dialog(QtGui.QDialog): self.clientProgressBar.setMaximum(Dialog.TotalBytes) self.clientProgressBar.setValue(self.bytesWritten) - self.clientStatusLabel.setText(self.tr("Sent %1MB") - .arg(self.bytesWritten / (1024 * 1024))) + self.clientStatusLabel.setText(self.tr("Sent %(sent)d MiB") + % {'sent': self.bytesWritten / (1024 * 1024)}) def displayError(self, socketError): if socketError == QtNetwork.QTcpSocket.RemoteHostClosedError: @@ -144,8 +144,8 @@ class Dialog(QtGui.QDialog): QtGui.QMessageBox.information(self, self.tr("Network error"), self.tr("The following error occured: "\ - "%1.") - .arg(self.tcpClient.errorString())) + "%(error)s.") + % {'error': self.tcpClient.errorString()}) self.tcpClient.close() self.tcpServer.close() |