summaryrefslogtreecommitdiffstats
path: root/iw
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2005-02-08 18:07:47 +0000
committerJeremy Katz <katzj@redhat.com>2005-02-08 18:07:47 +0000
commit0a7d9d2ad10c11b9c33192a270941be9ac1fd3ef (patch)
tree6bb70e0e181155da63949cdb9e5d8c9463f44611 /iw
parentf6ea1def73b140c91886306e30efd3b6b93b615c (diff)
downloadanaconda-0a7d9d2ad10c11b9c33192a270941be9ac1fd3ef.tar.gz
anaconda-0a7d9d2ad10c11b9c33192a270941be9ac1fd3ef.tar.xz
anaconda-0a7d9d2ad10c11b9c33192a270941be9ac1fd3ef.zip
2005-02-08 Jeremy Katz <katzj@redhat.com>
* iw/timezone_map_gui.py: Fix-up for new gnome-python2-canvas module naming. Handle fallback for older gnome-python2. * iw/partition_gui.py: Likewise.
Diffstat (limited to 'iw')
-rw-r--r--iw/partition_gui.py19
-rw-r--r--iw/timezone_map_gui.py15
2 files changed, 20 insertions, 14 deletions
diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index d847a6db8..1047d1f5f 100644
--- a/iw/partition_gui.py
+++ b/iw/partition_gui.py
@@ -16,7 +16,10 @@
import gobject
import gtk
-import gnome.canvas
+try:
+ import gnomecanvas
+except ImportError:
+ import gnome.canvas as gnomecanvas
import pango
import autopart
import gui
@@ -180,10 +183,10 @@ class DiskStripeSlice:
self.editCb = editCb
pgroup = parent.getGroup()
- self.group = pgroup.add(gnome.canvas.CanvasGroup)
- self.box = self.group.add(gnome.canvas.CanvasRect)
+ self.group = pgroup.add(gnomecanvas.CanvasGroup)
+ self.box = self.group.add(gnomecanvas.CanvasRect)
self.group.connect("event", self.eventHandler)
- self.text = self.group.add(gnome.canvas.CanvasText,
+ self.text = self.group.add(gnomecanvas.CanvasText,
font="sans", size_points=8)
self.update()
@@ -204,7 +207,7 @@ class DiskStripe:
else:
width = CANVAS_WIDTH_640
- group.add(gnome.canvas.CanvasRect, x1=0.0, y1=10.0, x2=width,
+ group.add(gnomecanvas.CanvasRect, x1=0.0, y1=10.0, x2=width,
y2=STRIPE_HEIGHT, fill_color='green',
outline_color='grey71', width_units=1.0)
group.lower_to_bottom()
@@ -255,7 +258,7 @@ class DiskStripe:
class DiskStripeGraph:
def __init__(self, tree, editCb):
- self.canvas = gnome.canvas.Canvas()
+ self.canvas = gnomecanvas.Canvas()
self.diskStripes = []
self.textlabels = []
self.tree = tree
@@ -299,7 +302,7 @@ class DiskStripeGraph:
def add(self, drive, disk):
# yoff = len(self.diskStripes) * (STRIPE_HEIGHT + 5)
yoff = self.next_ypos
- text = self.canvas.root().add(gnome.canvas.CanvasText,
+ text = self.canvas.root().add(gnomecanvas.CanvasText,
x=0.0, y=yoff,
font="sans",
size_points=9)
@@ -323,7 +326,7 @@ class DiskStripeGraph:
(xxx1, yyy1, xxx2, yyy2) = text.get_bounds()
textheight = yyy2 - yyy1
self.textlabels.append(text)
- group = self.canvas.root().add(gnome.canvas.CanvasGroup,
+ group = self.canvas.root().add(gnomecanvas.CanvasGroup,
x=0, y=yoff+textheight)
stripe = DiskStripe(drive, disk, group, self.tree, self.editCb)
self.diskStripes.append(stripe)
diff --git a/iw/timezone_map_gui.py b/iw/timezone_map_gui.py
index 3ef0ec762..c91e55bb5 100644
--- a/iw/timezone_map_gui.py
+++ b/iw/timezone_map_gui.py
@@ -14,7 +14,10 @@
import gobject
import pango
import gtk
-import gnome.canvas
+try:
+ import gnomecanvas
+except ImportError:
+ import gnome.canvas as gnomecanvas
import string
import re
import math
@@ -44,7 +47,7 @@ class TimezoneMap(gtk.VBox):
self.highlightedEntry = None
# set up the map canvas
- self.canvas = gnome.canvas.Canvas()
+ self.canvas = gnomecanvas.Canvas()
root = self.canvas.root()
tpixbuf = gtk.gdk.pixbuf_new_from_file(map)
@@ -61,20 +64,20 @@ class TimezoneMap(gtk.VBox):
self.mapWidth = pixbuf.get_width()
self.mapHeight = pixbuf.get_height()
- root.add(gnome.canvas.CanvasPixbuf, x=0, y=0, pixbuf=pixbuf)
+ root.add(gnomecanvas.CanvasPixbuf, x=0, y=0, pixbuf=pixbuf)
x1, y1, x2, y2 = root.get_bounds()
self.canvas.set_scroll_region(x1, y1, x2, y2)
self.canvas.set_size_request(int(x2), int(y2))
self.pack_start(self.canvas, gtk.FALSE, gtk.FALSE)
- self.current = root.add(gnome.canvas.CanvasText, text='x',
+ self.current = root.add(gnomecanvas.CanvasText, text='x',
fill_color='red', anchor=gtk.ANCHOR_CENTER,
weight=pango.WEIGHT_BOLD)
root.connect("event", self.mapEvent)
self.canvas.connect("event", self.canvasEvent)
- self.arrow = root.add(gnome.canvas.CanvasLine,
+ self.arrow = root.add(gnomecanvas.CanvasLine,
fill_color='limegreen',
width_pixels=2,
first_arrowhead=gtk.FALSE,
@@ -109,7 +112,7 @@ class TimezoneMap(gtk.VBox):
self.listStore.set_value(iter, self.columns.ENTRY, entry)
x, y = self.map2canvas(entry.lat, entry.long)
- marker = root.add(gnome.canvas.CanvasText, x=x, y=y,
+ marker = root.add(gnomecanvas.CanvasText, x=x, y=y,
text=u'\u00B7', fill_color='yellow',
anchor=gtk.ANCHOR_CENTER,
weight=pango.WEIGHT_BOLD)