client/rhel/rhn-client-tools/src/up2date_client/progress.py | 14 ++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
New commits:
commit 3058cc7849afd78321366e47cdf569c8a64d3cab
Author: Stephen Herr <sherr(a)redhat.com>
Date: Wed Oct 31 11:21:54 2012 -0400
871867 - progress bar in rhn-client-tools can now translate its title
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/progress.py
b/client/rhel/rhn-client-tools/src/up2date_client/progress.py
index 2242479..eed0428 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/progress.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/progress.py
@@ -5,12 +5,14 @@
# Author: Preston Brown <pbrown(a)redhat.com>
import gtk
+gtk.glade.bindtextdomain("rhn-client-tools")
class Progress:
def __init__(self):
glade_prefix = "/usr/share/rhn/up2date_client/"
- self.xml = gtk.glade.XML(glade_prefix + "progress.glade",
"progressWindow")
+ self.xml = gtk.glade.XML(glade_prefix + "progress.glade",
"progressWindow",
+ domain="rhn-client-tools")
self.progressWindow = self.xml.get_widget("progressWindow")
self.progressWindow.connect("delete-event", self.progressWindow.hide)
#self.progressWindow.connect("hide", self.progressWindow.hide)
@@ -25,7 +27,7 @@ class Progress:
self.progressWindow.hide()
while gtk.events_pending():
gtk.main_iteration(False)
-
+
del self
def setLabel(self, text):
@@ -33,15 +35,15 @@ class Progress:
label.set_text(text)
while gtk.events_pending():
gtk.main_iteration(False)
-
+
# the xmlrpc callbacks only use the first three
# the GET style use all 4, so pass em but dont use them
def setProgress(self, amount, total, speed = 0, secs = 0):
if total:
i = float(amount) / total
- else:
+ else:
i = 1
-
+
if i > 1:
i = 1
if i > self.lastProgress + .01 or i == 1:
@@ -64,7 +66,7 @@ class Progress:
gtk.main_iteration(False)
self.progressWindow.destroy()
-
+
def noop(self, win, event):
return True