diff options
author | Andrew Gaffney <agaffney@gentoo.org> | 2007-03-27 17:27:35 +0000 |
---|---|---|
committer | Andrew Gaffney <agaffney@gentoo.org> | 2007-03-27 17:27:35 +0000 |
commit | 7b691fc2b2ecb3e8589345e4300610b490781d83 (patch) | |
tree | 0249596a4fc7cbfb41cbcc5192869e8552fbc7ba | |
parent | use devnode instead of device (diff) | |
download | gli-7b691fc2b2ecb3e8589345e4300610b490781d83.tar.gz gli-7b691fc2b2ecb3e8589345e4300610b490781d83.tar.bz2 gli-7b691fc2b2ecb3e8589345e4300610b490781d83.zip |
list all available partitions and automatically populate the type field when they're selected
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/gli/trunk@1841 f8877401-5920-0410-a79b-8e2d7e04ca0d
-rw-r--r-- | src/fe/gtk/LocalMounts.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/fe/gtk/LocalMounts.py b/src/fe/gtk/LocalMounts.py index 146baa0..fb3ac93 100644 --- a/src/fe/gtk/LocalMounts.py +++ b/src/fe/gtk/LocalMounts.py @@ -9,6 +9,7 @@ import Widgets import commands, string import copy from ProgressDialog import * +import Partitioning class Panel(GLIScreen): @@ -66,6 +67,7 @@ can remove it from the list by clicking the 'Delete' button. mount_info_device_label.set_alignment(0.0, 0.5) mount_info_table.attach(mount_info_device_label, 0, 1, 0, 1) self.mount_info_device = gtk.ComboBoxEntry(gtk.ListStore(gobject.TYPE_STRING)) + self.mount_info_device.connect("changed", self.device_changed) if not self.mount_info_device.get_text_column() == 0: self.mount_info_device.set_text_column(0) mount_info_table.attach(self.mount_info_device, 1, 2, 0, 1) @@ -104,11 +106,21 @@ can remove it from the list by clicking the 'Delete' button. mount_button_box.pack_start(self.mount_button_delete, expand=False, fill=False, padding=10) vert.pack_start(mount_button_box, expand=False, fill=False, padding=10) + self.partitions = {} + for device in Partitioning.detect_devices(): + drive = Partitioning.Device(device, self.controller.cc.get_arch(), self.controller.install_profile) + for part in drive: + self.partitions[part['devnode']] = part['type'] + self.part_list = self.partitions.keys() + self.part_list.sort() + for part in self.part_list: + self.mount_info_device.get_model().append([part]) + self.add_content(vert) def disable_all_fields(self): self.mount_info_device.get_child().set_text("") - self.mount_info_device.set_model(gtk.ListStore(gobject.TYPE_STRING)) +# self.mount_info_device.set_model(gtk.ListStore(gobject.TYPE_STRING)) self.mount_info_type.set_text("") self.mount_info_mountpoint.set_text("") self.mount_info_mountopts.set_text("") @@ -119,7 +131,7 @@ can remove it from the list by clicking the 'Delete' button. def enable_all_fields(self): self.mount_info_device.get_child().set_text("") - self.mount_info_device.set_model(gtk.ListStore(gobject.TYPE_STRING)) +# self.mount_info_device.set_model(gtk.ListStore(gobject.TYPE_STRING)) self.mount_info_mountpoint.set_text("") self.mount_info_mountopts.set_text("") self.mount_info_device.set_sensitive(True) @@ -203,6 +215,9 @@ can remove it from the list by clicking the 'Delete' button. self.refresh_list_at_top() self.disable_all_fields() + def device_changed(self, comboentry): + self.mount_info_type.set_text(self.partitions[self.mount_info_device.get_child().get_text()]) + def activate(self): self.controller.SHOW_BUTTON_BACK = True self.controller.SHOW_BUTTON_FORWARD = True |