summaryrefslogtreecommitdiffstats
path: root/iw/datacombo.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2004-11-11 17:05:48 +0000
committerJeremy Katz <katzj@redhat.com>2004-11-11 17:05:48 +0000
commit20de3c4b1a02a7133a96f19e6c964a55175b2b45 (patch)
treeaa40ef32fb5af6e2b083f6b9bb03cc3300fa7a3d /iw/datacombo.py
parent409a6d2f2b725692f12bdf1274682847155f513d (diff)
downloadanaconda-20de3c4b1a02a7133a96f19e6c964a55175b2b45.tar.gz
anaconda-20de3c4b1a02a7133a96f19e6c964a55175b2b45.tar.xz
anaconda-20de3c4b1a02a7133a96f19e6c964a55175b2b45.zip
2004-11-11 Jeremy Katz <katzj@redhat.com>
* iw/partition_ui_helpers_gui.py (mountptchangeCB): Automatically set the filesystem type to vfat if the user selects /boot/efi as the mountpoint on ia64 (#138580) * iw/datacombo.py (DataComboBox.set_active_text): Add convenience method to set the active item based on text.
Diffstat (limited to 'iw/datacombo.py')
-rw-r--r--iw/datacombo.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/iw/datacombo.py b/iw/datacombo.py
index e71e48e7d..abb7193f5 100644
--- a/iw/datacombo.py
+++ b/iw/datacombo.py
@@ -50,6 +50,16 @@ class DataComboBox(gtk.ComboBox):
def get_text(self, row):
return self.get_stored_data(row, col = 0)
+ def set_active_text(self, t):
+ n = 0
+ i = self.store.get_iter(n)
+ while i is not None:
+ if self.store.get_value(i, 0) == t:
+ self.set_active(n)
+ break
+ i = self.store.iter_next(i)
+ n += 1
+
def clear(self):
self.store.clear()
@@ -65,7 +75,7 @@ if __name__ == "__main__":
cb.append("/dev/hda6", "hda6")
cb.append("/dev/hda7", "hda7")
cb.append("/dev/hda8", "hda8")
- cb.set_active(0)
+ cb.set_active_text("/dev/hda7")
cb.connect('changed', mycb)