/[gli]/branches/overhaul/src/fe/gtk/Partition.py
Gentoo

Diff of /branches/overhaul/src/fe/gtk/Partition.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1595 Revision 1596
18 part_buttons = {} 18 part_buttons = {}
19 drives = [] 19 drives = []
20 devices = {} 20 devices = {}
21 active_device = "" 21 active_device = ""
22 active_device_bytes_in_sector = 0 22 active_device_bytes_in_sector = 0
23 active_part_min_size = 0
24 active_part_max_size = 0
25 active_part_cur_size = 0
26 active_part_start_cyl = 0
27 active_part_minor = 0 23 active_part_idx = -1
28 colors = { 'ext2': '#0af2fe', 'ext3': '#0af2fe', 'unalloc': '#a2a2a2', 'unknown': '#ed03e0', 'free': '#ffffff', 'ntfs': '#f20600', 'fat16': '#3d07f9', 'fat32': '#3d07f9', 'reiserfs': '#f0ff00', 'linux-swap': '#12ff09', 'xfs': '#006600', 'jfs': '#ffb400', 'hfs': '#fdb0ff', 'hfs+': '#fdb0ff', 'apple_bootstrap': '#fdb0ff' } 24 colors = { 'ext2': '#0af2fe', 'ext3': '#0af2fe', 'unalloc': '#a2a2a2', 'unknown': '#ed03e0', 'free': '#ffffff', 'ntfs': '#f20600', 'fat16': '#3d07f9', 'fat32': '#3d07f9', 'reiserfs': '#f0ff00', 'linux-swap': '#12ff09', 'xfs': '#006600', 'jfs': '#ffb400', 'hfs': '#fdb0ff', 'hfs+': '#fdb0ff', 'apple_bootstrap': '#fdb0ff' }
29 supported_filesystems = ["ext2", "ext3", "linux-swap", "xfs", "jfs", "reiserfs", "fat16", "fat32", "ntfs", "hfs", "hfs+"] 25 supported_filesystems = ["ext2", "ext3", "linux-swap", "xfs", "jfs", "reiserfs", "fat16", "fat32", "ntfs", "hfs", "hfs+"]
30 _helptext = """ 26 _helptext = """
31<b><u>Partitioning</u></b> 27<b><u>Partitioning</u></b>
32 28
252# self.info_start.set_text(str(start)) 248# self.info_start.set_text(str(start))
253# self.info_end.set_text(str(end)) 249# self.info_end.set_text(str(end))
254# part_size = int(round(float(self.devices[dev].get_sector_size()) * (end - start + 1) / 1024 / 1024)) 250# part_size = int(round(float(self.devices[dev].get_sector_size()) * (end - start + 1) / 1024 / 1024))
255 part_size = int(tmppart.get_mb()) 251 part_size = int(tmppart.get_mb())
256 self.info_size.set_text(str(part_size) + _(" MB")) 252 self.info_size.set_text(str(part_size) + _(" MB"))
257 self.active_part_minor = int(tmppart.get_minor()) 253 self.active_part_idx = idx
258 self.part_button_delete.set_sensitive(True) 254 self.part_button_delete.set_sensitive(True)
259 self.part_info_box.show_all() 255 self.part_info_box.show_all()
260 self.part_button_box.show_all() 256 self.part_button_box.show_all()
261 257
262 def unalloc_selected(self, button, dev=None, extended=False, mb=0, minor=0): 258 def unalloc_selected(self, button, dev=None, extended=False, mb=0, minor=0):
263 props = PartProperties.PartProperties(self, self.active_device, minor, 0, 0, mb, "free", self.active_device_bytes_in_sector) 259 props = PartProperties.PartProperties(self, self.active_device, minor, 0, 0, mb, "free", self.active_device_bytes_in_sector)
264 props.run() 260 props.run()
265 261
266 def part_button_delete_clicked(self, button, data=None): 262 def part_button_delete_clicked(self, button, data=None):
267 msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format=_("Are you sure you want to delete ") + self.devices[self.active_device][self.active_part_minor]['devnode']) 263 msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format=_("Are you sure you want to delete ") + self.devices[self.active_device].get_partition(self.active_part_idx)['devnode'])
268 resp = msgdlg.run() 264 resp = msgdlg.run()
269 msgdlg.destroy() 265 msgdlg.destroy()
270 if resp == gtk.RESPONSE_YES: 266 if resp == gtk.RESPONSE_YES:
271 self.devices[self.active_device].remove_partition(self.active_part_minor) 267 self.devices[self.active_device].remove_partition(self.active_part_idx)
272 if self.devices[self.active_device]._labelinfo['extended'] and self.active_part_minor > 4: 268 if self.devices[self.active_device]._labelinfo['extended'] and self.active_part_minor > 4:
273 ext_part = self.devices[self.active_device].get_extended_partition() 269 ext_part = self.devices[self.active_device].get_extended_partition()
274 if not len(self.devices[self.active_device].get_partition(ext_part).get_logicals()): 270 if not len(self.devices[self.active_device].get_partition(ext_part).get_logicals()):
275 self.devices[self.active_device].remove_partition(ext_part) 271 self.devices[self.active_device].remove_partition(ext_part)
276 self.drive_changed(None) 272 self.drive_changed(None)
364 import pprint 360 import pprint
365 pp = pprint.PrettyPrinter(indent=4) 361 pp = pprint.PrettyPrinter(indent=4)
366 pp.pprint(self.devices[self.active_device].get_install_profile_structure()) 362 pp.pprint(self.devices[self.active_device].get_install_profile_structure())
367 363
368 def part_button_properties_clicked(self, widget, data=None): 364 def part_button_properties_clicked(self, widget, data=None):
369 tmppart = self.devices[self.active_device].get_partition(self.active_part_minor) 365 tmppart = self.devices[self.active_device].get_partition(self.active_part_idx)
370 props = PartProperties.PartProperties(self, self.active_device, self.active_part_minor, tmppart.get_mb(), tmppart.get_min_mb_for_resize(), tmppart.get_max_mb_for_resize(), tmppart.get_type(), self.active_device_bytes_in_sector, format=tmppart.get_format()) 366 props = PartProperties.PartProperties(self, self.active_device, self.active_part_idx)
371 props.run() 367 props.run()
372 368
373 def activate(self): 369 def activate(self):
374 self.controller.SHOW_BUTTON_EXIT = True 370 self.controller.SHOW_BUTTON_EXIT = True
375 self.controller.SHOW_BUTTON_HELP = True 371 self.controller.SHOW_BUTTON_HELP = True

Legend:
Removed from v.1595  
changed lines
  Added in v.1596

  ViewVC Help
Powered by ViewVC 1.1.20