summaryrefslogtreecommitdiff
path: root/DistUpgrade
diff options
context:
space:
mode:
authorMichael Vogt <egon@top>2005-12-07 14:18:54 +0100
committerMichael Vogt <egon@top>2005-12-07 14:18:54 +0100
commita018bea8d686418dc8cb5dc443a559b41c8eb4c2 (patch)
treeb6fa2450fbe9e15765a183bb3ba9d0d9ee478b1d /DistUpgrade
parent1cc5a78218011a78fb69ca7c3d6afb885cf8f4a7 (diff)
downloadpython-apt-a018bea8d686418dc8cb5dc443a559b41c8eb4c2.tar.gz
* ui-polish for the step that are performed
Diffstat (limited to 'DistUpgrade')
-rw-r--r--DistUpgrade/DistUpgrade.glade52
-rw-r--r--DistUpgrade/DistUpgradeControler.py12
-rw-r--r--DistUpgrade/DistUpgradeViewGtk.py24
-rwxr-xr-xDistUpgrade/dist-upgrade.py5
4 files changed, 56 insertions, 37 deletions
diff --git a/DistUpgrade/DistUpgrade.glade b/DistUpgrade/DistUpgrade.glade
index 4773b007..05d6fe10 100644
--- a/DistUpgrade/DistUpgrade.glade
+++ b/DistUpgrade/DistUpgrade.glade
@@ -30,13 +30,13 @@
<child>
<widget class="GtkLabel" id="label_title">
<property name="visible">True</property>
- <property name="label" translatable="yes">&lt;big&gt;&lt;b&gt;Distribution upgrade&lt;/b&gt;&lt;/big&gt;</property>
+ <property name="label" translatable="yes">&lt;span weight=&quot;bold&quot; size=&quot;x-large&quot;&gt;Distribution upgrade&lt;/span&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
- <property name="xalign">0.5</property>
+ <property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">12</property>
<property name="ypad">12</property>
@@ -53,6 +53,10 @@
</child>
<child>
+ <placeholder/>
+ </child>
+
+ <child>
<widget class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="xalign">0.5</property>
@@ -60,7 +64,7 @@
<property name="xscale">1</property>
<property name="yscale">1</property>
<property name="top_padding">0</property>
- <property name="bottom_padding">12</property>
+ <property name="bottom_padding">24</property>
<property name="left_padding">12</property>
<property name="right_padding">12</property>
@@ -70,13 +74,13 @@
<property name="n_rows">4</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
- <property name="row_spacing">12</property>
- <property name="column_spacing">12</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">0</property>
<child>
<widget class="GtkImage" id="image_step1">
- <property name="width_request">16</property>
- <property name="height_request">16</property>
+ <property name="width_request">18</property>
+ <property name="height_request">18</property>
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
@@ -93,8 +97,8 @@
<child>
<widget class="GtkImage" id="image_step2">
- <property name="width_request">16</property>
- <property name="height_request">16</property>
+ <property name="width_request">18</property>
+ <property name="height_request">18</property>
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
@@ -112,8 +116,8 @@
<child>
<widget class="GtkImage" id="image_step3">
- <property name="width_request">16</property>
- <property name="height_request">16</property>
+ <property name="width_request">18</property>
+ <property name="height_request">18</property>
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
@@ -131,8 +135,8 @@
<child>
<widget class="GtkImage" id="image_step4">
- <property name="width_request">16</property>
- <property name="height_request">16</property>
+ <property name="width_request">18</property>
+ <property name="height_request">18</property>
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
@@ -171,7 +175,7 @@
<property name="right_attach">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
+ <property name="x_options">expand|shrink|fill</property>
<property name="y_options"></property>
</packing>
</child>
@@ -199,7 +203,7 @@
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
+ <property name="x_options">expand|shrink|fill</property>
<property name="y_options"></property>
</packing>
</child>
@@ -227,7 +231,7 @@
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
+ <property name="x_options">expand|shrink|fill</property>
<property name="y_options"></property>
</packing>
</child>
@@ -255,7 +259,7 @@
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
+ <property name="x_options">expand|shrink|fill</property>
<property name="y_options"></property>
</packing>
</child>
@@ -286,13 +290,13 @@
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">12</property>
- <property name="right_padding">0</property>
+ <property name="right_padding">12</property>
<child>
<widget class="GtkVBox" id="vbox5">
<property name="visible">True</property>
<property name="homogeneous">False</property>
- <property name="spacing">0</property>
+ <property name="spacing">6</property>
<child>
<widget class="GtkLabel" id="label_status">
@@ -301,9 +305,9 @@
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
+ <property name="wrap">True</property>
<property name="selectable">False</property>
- <property name="xalign">0.5</property>
+ <property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
@@ -321,10 +325,12 @@
<child>
<widget class="GtkProgressBar" id="progressbar_cache">
+ <property name="width_request">350</property>
<property name="visible">True</property>
<property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property>
<property name="fraction">0</property>
<property name="pulse_step">0.10000000149</property>
+ <property name="text" translatable="yes"> </property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
</widget>
<packing>
@@ -341,7 +347,7 @@
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
+ <property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
@@ -412,7 +418,7 @@
<child>
<widget class="GtkLabel" id="label16">
<property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Action&lt;/b&gt;</property>
+ <property name="label" translatable="yes">&lt;b&gt;Current Step&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py
index a6fc4111..267cf939 100644
--- a/DistUpgrade/DistUpgradeControler.py
+++ b/DistUpgrade/DistUpgradeControler.py
@@ -35,12 +35,15 @@ class DistUpgradeControler(object):
def __init__(self, distUpgradeView):
self._view = distUpgradeView
self._view.updateStatus(_("Reading cache"))
- self._cache = MyCache(self._view.getOpCacheProgress())
+ self._cache = None
# some constants here
self.fromDist = "hoary"
self.toDist = "breezy"
self.origin = "Ubuntu"
+ def openCache(self):
+ self._cache = MyCache(self._view.getOpCacheProgress())
+
def sanityCheck(self):
if self._cache._depcache.BrokenCount > 0:
# FIXME: we more helpful here and offer to actually fix the
@@ -197,6 +200,7 @@ class DistUpgradeControler(object):
# sanity check (check for ubuntu-desktop, brokenCache etc)
self._view.updateStatus(_("Checking the system"))
self._view.setStep(1)
+ self.openCache()
if not self.sanityCheck():
sys.exit(1)
@@ -213,7 +217,7 @@ class DistUpgradeControler(object):
# then open the cache (again)
self._view.updateStatus(_("Reading cache"))
- self._cache = MyCache(self._view.getOpCacheProgress())
+ self.openCache()
# calc the dist-upgrade and see if the removals are ok/expected
# do the dist-upgrade
@@ -235,7 +239,3 @@ class DistUpgradeControler(object):
self.breezyUpgrade()
-if __name__ == "__main__":
- view = GtkDistUpgradeView()
- app = DistUpgradeControler(view)
- app.run()
diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py
index 4bf6e8e2..e78ed287 100644
--- a/DistUpgrade/DistUpgradeViewGtk.py
+++ b/DistUpgrade/DistUpgradeViewGtk.py
@@ -5,6 +5,7 @@ import gtk.gdk
import gtk.glade
import vte
import gobject
+import pango
import apt
import apt_pkg
@@ -18,16 +19,16 @@ from gettext import gettext as _
class GtkOpProgress(apt.progress.OpProgress):
def __init__(self, progressbar):
- self._progressbar = progressbar
+ self.progressbar = progressbar
def update(self, percent):
#self._progressbar.show()
- self._progressbar.set_text(self.op)
- self._progressbar.set_fraction(percent/100.0)
+ self.progressbar.set_text(self.op)
+ self.progressbar.set_fraction(percent/100.0)
while gtk.events_pending():
gtk.main_iteration()
def done(self):
- #self._progressbar.hide()
- pass
+ #self.progressbar.hide()
+ self.progressbar.set_text(" ")
class GtkFetchProgressAdapter(apt.progress.FetchProgress):
@@ -44,6 +45,7 @@ class GtkFetchProgressAdapter(apt.progress.FetchProgress):
self.status.show()
def stop(self):
#self.progress.hide()
+ self.progress.set_text(" ")
self.status.set_text("")
def pulse(self):
# FIXME: move the status_str and progress_str into python-apt
@@ -81,7 +83,7 @@ class GtkInstallProgressAdapter(InstallProgress):
self.label_status.set_text(_("Installing updates ..."))
#self.progress.show()
self.progress.set_fraction(0.0)
- self.progress.set_text("")
+ self.progress.set_text(" ")
self.expander.show()
self.term.show()
self.env = ["VTE_PTY_KEEP_FD=%s"% self.writefd,
@@ -148,15 +150,21 @@ class GtkDistUpgradeView(DistUpgradeView,SimpleGladeApp):
def setStep(self, step):
# first update the "last" step as completed
size = gtk.ICON_SIZE_MENU
+ attrlist=pango.AttrList()
if step > 1:
image = getattr(self,"image_step%i" % (step-1))
label = getattr(self,"label_step%i" % (step-1))
image.set_from_stock(gtk.STOCK_APPLY, size)
+ label.set_property("attributes",attrlist)
image = getattr(self,"image_step%i" % step)
label = getattr(self,"label_step%i" % step)
image.set_from_stock(gtk.STOCK_YES, size)
-
-
+ # we can't make it bold here without layout changes in the view :(
+ #attr = pango.AttrWeight(pango.WEIGHT_BOLD, 0, -1)
+ attr = pango.AttrStyle(pango.STYLE_ITALIC, 0, -1)
+ attrlist.insert(attr)
+ label.set_property("attributes",attrlist)
+
def error(self, summary, msg):
dialog = gtk.MessageDialog(self.window_main, 0, gtk.MESSAGE_ERROR,
gtk.BUTTONS_OK,"")
diff --git a/DistUpgrade/dist-upgrade.py b/DistUpgrade/dist-upgrade.py
index 4ac8422b..022e87d2 100755
--- a/DistUpgrade/dist-upgrade.py
+++ b/DistUpgrade/dist-upgrade.py
@@ -7,3 +7,8 @@ if __name__ == "__main__":
view = GtkDistUpgradeView()
app = DistUpgradeControler(view)
app.run()
+
+ # testcode to see if the bullets look nice in the dialog
+ #for i in range(4):
+ # view.setStep(i+1)
+ # app.openCache()