summaryrefslogtreecommitdiff
path: root/UpdateManager/GtkProgress.py
diff options
context:
space:
mode:
authorSebastian Heinlein <sebastian.heinlein@web.de>2006-01-25 11:44:07 +0100
committerSebastian Heinlein <sebastian.heinlein@web.de>2006-01-25 11:44:07 +0100
commit04314c42545fa783b12c9c7b7ec88200afa5e3f2 (patch)
tree1a6df51a73425f8cfba3c36739c727d8e04b8da8 /UpdateManager/GtkProgress.py
parent1525567ae3aa901996c186ed070f8c9746dc58a9 (diff)
downloadpython-apt-04314c42545fa783b12c9c7b7ec88200afa5e3f2.tar.gz
DistUpgrade:
* set position of main window to "center" and not "center always" Update Manager: * Hopefully fix the close/cancel issue #28932: - Move the install button next to the update treeview. So it is no longer a global action of the dialog and separated from the close button. - Use a close button instead of the cancel button * Check if automatic internet updates is disabled and show an information about the need of reloading as the case may be * unset sensitive of main window during caching * Do not set a title in the download dialog * Show only the time in the progress bar * Use "Downloading file X of Y with 122/s" in the status label * Do not set the update treeview unsensitive during the download of the package related changelog
Diffstat (limited to 'UpdateManager/GtkProgress.py')
-rw-r--r--UpdateManager/GtkProgress.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/UpdateManager/GtkProgress.py b/UpdateManager/GtkProgress.py
index d25149e4..025858e3 100644
--- a/UpdateManager/GtkProgress.py
+++ b/UpdateManager/GtkProgress.py
@@ -27,7 +27,7 @@ import apt_pkg
from gettext import gettext as _
class GtkOpProgress(apt.OpProgress):
- def __init__(self, window,progressbar, parent):
+ def __init__(self, window, progressbar, parent):
self._parent = parent
self._window = window
self._progressbar = progressbar
@@ -37,11 +37,13 @@ class GtkOpProgress(apt.OpProgress):
#print self.Op
#print self.SubOp
self._window.show()
+ self._parent.set_sensitive(False)
self._progressbar.set_text(self.op)
self._progressbar.set_fraction(percent/100.0)
while gtk.events_pending():
gtk.main_iteration()
def done(self):
+ self._parent.set_sensitive(True)
self._window.hide()
class GtkFetchProgress(apt.progress.FetchProgress):
@@ -59,7 +61,6 @@ class GtkFetchProgress(apt.progress.FetchProgress):
if self.summary != "":
self.summary.set_markup("<big><b>%s</b></big> \n\n%s" %
(summary, descr))
- self.window_fetch.set_title(summary)
def start(self):
self.progress.set_fraction(0)
self.window_fetch.show()
@@ -69,15 +70,20 @@ class GtkFetchProgress(apt.progress.FetchProgress):
self._continue = False
def pulse(self):
apt.progress.FetchProgress.pulse(self)
- if self.currentCPS > 0:
- self.status.set_text(_("Download rate: %s/s - %s remaining" % (apt_pkg.SizeToStr(self.currentCPS), apt_pkg.TimeToStr(self.eta))))
- else:
- self.status.set_text(_("Download rate: unkown"))
- self.progress.set_fraction(self.percent/100.0)
currentItem = self.currentItems + 1
if currentItem > self.totalItems:
currentItem = self.totalItems
- self.progress.set_text(_("Downloading file %li of %li" % (currentItem, self.totalItems)))
+ if self.currentCPS > 0:
+ self.status.set_text(_("Downloading file %li of %li with %s/s"
+ % (currentItem, self.totalItems,
+ apt_pkg.SizeToStr(self.currentCPS))))
+ else:
+ self.status.set_text(_("Downloading file %li of %li with unknown "
+ "speed") % (currentItem, self.totalItems))
+ self.progress.set_fraction(self.percent/100.0)
+# self.progress.set_text(_("Time remaining %s" % (apt_pkg.TimeToStr(self.eta))))
+ self.progress.set_text(_("Time remaining"))
+
while gtk.events_pending():
gtk.main_iteration()
return self._continue