summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2002-06-17 19:14:43 +0000
committerMatt Wilson <msw@redhat.com>2002-06-17 19:14:43 +0000
commitcd6c235fd0291888df9d2d8bfd378c1459b5387a (patch)
tree40c8111be7c6b2f5db393e7dcbc16f3acb2a819e
parent4f96a697569827dd88e662f884e0fa000d962b75 (diff)
downloadanaconda-cd6c235fd0291888df9d2d8bfd378c1459b5387a.tar.gz
anaconda-cd6c235fd0291888df9d2d8bfd378c1459b5387a.tar.xz
anaconda-cd6c235fd0291888df9d2d8bfd378c1459b5387a.zip
1) replace zvt in fdisk screen with vte (fdisk_gui.py, upd-instroot)
2) avoid going into a infinite loop when looking for partitions in the tree model -- this was happening because the partition in question was a parent node, and was being skipped.
-rw-r--r--iw/fdisk_gui.py17
-rw-r--r--iw/partition_gui.py55
-rwxr-xr-xscripts/upd-instroot5
3 files changed, 40 insertions, 37 deletions
diff --git a/iw/fdisk_gui.py b/iw/fdisk_gui.py
index 2eb079c54..ac0a0917e 100644
--- a/iw/fdisk_gui.py
+++ b/iw/fdisk_gui.py
@@ -13,7 +13,7 @@
import gtk
from iw_gui import *
-from gnome import zvt
+import vte
from rhpl.translate import _
from dispatch import DISPATCH_NOOP
import partitioning
@@ -36,7 +36,7 @@ class FDiskWindow (InstallWindow):
def child_died (self, widget, button):
- self.windowContainer.remove (self.windowContainer.children ()[0])
+ self.windowContainer.remove (self.windowContainer.get_children ()[0])
self.windowContainer.pack_start (self.buttonBox)
button.set_state (gtk.STATE_NORMAL)
try:
@@ -52,9 +52,10 @@ class FDiskWindow (InstallWindow):
def button_clicked (self, widget, drive):
- term = zvt.Term(80, 24)
- term.set_del_key_swap(gtk.TRUE)
- term.connect("child_died", self.child_died, widget)
+ term = vte.Terminal()
+ term.set_encoding("UTF-8")
+ term.set_font_from_string("monospace")
+ term.connect("child_exited", self.child_died, widget)
self.drive = drive
# free our fd's to the hard drive -- we have to
@@ -66,9 +67,7 @@ class FDiskWindow (InstallWindow):
isys.makeDevInode(drive, '/tmp/' + drive)
- if term.forkpty() == 0:
- env = os.environ
- os.execve (path, (path, '/tmp/' + drive), env)
+ term.fork_command(path, (path, '/tmp/' + drive))
term.show()
self.windowContainer.remove(self.buttonBox)
@@ -107,7 +106,7 @@ class FDiskWindow (InstallWindow):
sw = gtk.ScrolledWindow()
sw.add_with_viewport(box)
sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
- viewport = sw.children()[0]
+ viewport = sw.get_children()[0]
viewport.set_shadow_type(gtk.SHADOW_ETCHED_IN)
sw.set_size_request(-1, 400)
diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index 5868b5f56..91846002c 100644
--- a/iw/partition_gui.py
+++ b/iw/partition_gui.py
@@ -368,19 +368,15 @@ class DiskTreeModel(gtk.TreeStore):
def selectPartition(self, partition):
pyobject = self.titleSlot['PyObject']
iter = self.get_iter_first()
- next = 1
- parentstack = []
+ parentstack = [None,]
parent = None
# iterate over the list, looking for the current mouse selection
- while next:
- # if this is a parent node, get the first child and iter over them
- if self.iter_has_child(iter):
- parent = iter
- parentstack.append(parent)
- iter = self.iter_children(parent)
- continue
- # if it's not a parent node and the mouse matches, select it.
- elif self.get_value(iter, pyobject) == partition:
+ while iter:
+ try:
+ rowpart = self.get_value(iter, pyobject)
+ except SystemError:
+ rowpart = None
+ if rowpart == partition:
path = self.get_path(parent)
self.view.expand_row(path, gtk.TRUE)
selection = self.view.get_selection()
@@ -391,23 +387,32 @@ class DiskTreeModel(gtk.TreeStore):
self.view.set_cursor(path, col, gtk.FALSE)
self.view.scroll_to_cell(path, col, gtk.TRUE, 0.5, 0.5)
return
+ # if this is a parent node, and it didn't point to the partition
+ # we're looking for, get the first child and iter over them
+ elif self.iter_has_child(iter):
+ parent = iter
+ parentstack.append(iter)
+ iter = self.iter_children(iter)
+ continue
# get the next row.
- next = self.iter_next(iter)
- # if there isn't a next row and we had a parent, go to the node
- # after the parent we've just gotten the children of.
- if not next and parent:
- while not next and parent:
- next = self.iter_next(parent)
- iter = parent
+ success = self.iter_next(iter)
+ # if there isn't a next row and we had a parent, go to the next
+ # node after our parent
+ if not success and parent:
+ while not success and parent:
+ iter = parent
+ success = self.iter_next(iter)
if len(parentstack) > 0:
parent = parentstack.pop()
+ else:
+ # we've fallen off the end of the model, and we have
+ # not found the partition
+ raise RuntimeError, "could not find partition"
def getCurrentPartition(self):
selection = self.view.get_selection()
- rc = selection.get_selected()
- if rc:
- model, iter = rc
- else:
+ model, iter = selection.get_selected()
+ if not iter:
return None
pyobject = self.titleSlot['PyObject']
@@ -753,10 +758,8 @@ class PartitionWindow(InstallWindow):
self.editCb()
def treeSelectCb(self, selection, *args):
- rc = selection.get_selected()
- if rc:
- model, iter = rc
- else:
+ model, iter = selection.get_selected()
+ if not iter:
return
partition = model[iter]['PyObject']
if partition:
diff --git a/scripts/upd-instroot b/scripts/upd-instroot
index c10da8667..3d7e1c3ea 100755
--- a/scripts/upd-instroot
+++ b/scripts/upd-instroot
@@ -129,7 +129,7 @@ PACKAGESGR="anaconda XFree86-libs imlib libpng libtiff libjpeg
XFree86 Xconfigurator gnome-python2 pygtk2 gdk-pixbuf
XFree86-KOI8-R XFree86-KOI8-R-75dpi-fonts pciutils pam
reiserfs-utils atk pango freetype gnome-python2-canvas
- libgnomecanvas libart_lgpl libzvt gnome-python2-zvt
+ libgnomecanvas libart_lgpl vte
anaconda-images anaconda-help hdparm XFree86-base-fonts
ttfonts-ko taipeifonts XFree86-ISO8859-15-75dpi-fonts rhpl
redhat-config-keyboard Xft fontconfig expat redhat-artwork"
@@ -293,6 +293,7 @@ usr/lib/librpmio*4.0.4.so*
usr/lib/libslang*
usr/lib/libz.*
usr/lib/python2.2/*
+usr/lib/python2.2/site-packages/*vte*
usr/lib/python2.2/site-packages/*kudzu*
usr/lib/python2.2/site-packages/rpmmodule.so
usr/lib/python2.2/site-packages/partedmodule.so
@@ -587,7 +588,7 @@ usr/lib/libpng12*
usr/lib/libreadline*
usr/lib/libthread*
usr/lib/libtiff*
-usr/lib/libzvt-2*
+usr/lib/libvte*
usr/lib/locale/*
usr/lib/pango/*
usr/lib/rpm/rpmpopt