def __init__(self, CFG): gtk.Fixed.__init__(self) self.metodo = CFG['metodo'] self.particiones = CFG['particiones'] self.forma = 'ROOT:HOME:SWAP:LIBRE' self.minimo = ESPACIO_TOTAL self.nuevas = [] self.acciones = [] self.libre = 0 txt_info = _("Select the partition layout to use. Use the selector to \ indicate the size you want to use for installation of Canaima.") self.lbl1 = gtk.Label(txt_info) self.lbl1.set_size_request(690, 35) self.lbl1.set_alignment(0, 0) self.lbl1.set_line_wrap(True) atk_label(self.lbl1) self.put(self.lbl1, 0, 0) tip_msg = _("Select this button to use the minimum disk \ space for the Canaima installation") self.tam_min = gtk.Button() self.tam_min.set_label(_("Minimum")) self.tam_min.set_size_request(80, 25) self.tam_min.connect('clicked', self.set_min) self.tam_min.set_tooltip_text(tip_msg) self.put(self.tam_min, 525, 40) tip_msg = _("Select this button to use the maximum disk \ space for the Canaima installation") self.tam_max = gtk.Button() self.tam_max.set_label(_('Maximum')) self.tam_max.set_size_request(80, 25) self.tam_max.connect('clicked', self.set_max) self.tam_max.set_tooltip_text(tip_msg) self.put(self.tam_max, 610, 40) self.barra = BarraTodo(self) self.barra.set_size_request(690, 100) self.put(self.barra, 0, 70) msg_1 = _("Install everything in a single partition.") self.option_1 = gtk.RadioButton(None, msg_1) self.option_1.connect("toggled", self.change_option, "ROOT:SWAP:LIBRE") self.option_1.set_size_request(350, 20) self.put(self.option_1, 0, 185) msg_2 = _("Separate /home partition (recommended).") self.option_2 = gtk.RadioButton(self.option_1, msg_2) self.option_2.connect("toggled", self.change_option, "ROOT:HOME:SWAP:LIBRE") self.option_2.set_size_request(350, 20) self.put(self.option_2, 0, 210) msg_3 = _("Separate /home and /boot.") self.option_3 = gtk.RadioButton(self.option_1, msg_3) self.option_3.connect("toggled", self.change_option, "BOOT:ROOT:HOME:SWAP:LIBRE") self.option_3.set_size_request(350, 20) self.put(self.option_3, 0, 235) msg_4 = _("Separate /home, /boot, /var and /usr.") self.option_4 = gtk.RadioButton(self.option_1, msg_4) self.option_4.connect("toggled", self.change_option, "BOOT:ROOT:VAR:USR:HOME:SWAP:LIBRE") self.option_4.set_size_request(350, 20) self.put(self.option_4, 0, 260) self.leyenda = Leyenda(self) self.leyenda.set_size_request(300, 150) self.put(self.leyenda, 390, 185) self.option_2.set_active(True) if self.metodo['tipo'] != 'TODO' and self.metodo['disco'][4] > 0: if self.metodo['part'][5] == 'primary': if self.metodo['disco'][3] == 0: # Disponibles: root+swap, root+home+swap self.option_3.set_sensitive(False) self.option_4.set_sensitive(False) elif self.metodo['disco'][3] == 1: # Disponibles: root+swap self.option_1.set_active(True) self.option_2.set_sensitive(False) self.option_3.set_sensitive(False) self.option_4.set_sensitive(False) elif self.metodo['part'][5] == 'logical': if self.metodo['disco'][5] == 7: # Disponibles: root+swap, root+home+swap, # boot+root+home+swap self.option_4.set_sensitive(False) elif self.metodo['disco'][5] == 6: # Disponibles: root+swap, root+home+swap, # boot+root+home+swap self.option_4.set_sensitive(False) elif self.metodo['disco'][5] == 8: # Disponibles: root+swap, root+home+swap self.option_3.set_sensitive(False) self.option_4.set_sensitive(False) elif self.metodo['disco'][5] == 9: # Disponibles: root+swap self.option_1.set_active(True) self.option_2.set_sensitive(False) self.option_3.set_sensitive(False) self.option_4.set_sensitive(False)
def __init__(self, CFG): gtk.Fixed.__init__(self) self.metodo = CFG['metodo'] self.particiones = CFG['particiones'] self.forma = 'ROOT:HOME:SWAP:LIBRE' self.minimo = ESPACIO_TOTAL self.nuevas = [] self.acciones = [] self.libre = 0 txt_info = "Seleccione la distribución de las particiones que desea utilizar. Utilice el selector para indicar el tamaño que desea utilizar para la instalación de Canaima." self.lbl1 = gtk.Label(txt_info) self.lbl1.set_size_request(690, 35) self.lbl1.set_alignment(0, 0) self.lbl1.set_line_wrap(True) self.put(self.lbl1, 0, 0) self.tam_min = gtk.Button() self.tam_min.set_label('Mínimo') self.tam_min.set_size_request(80, 25) self.tam_min.connect('clicked', self.set_min) self.put(self.tam_min, 525, 40) self.tam_max = gtk.Button() self.tam_max.set_label('Máximo') self.tam_max.set_size_request(80, 25) self.tam_max.connect('clicked', self.set_max) self.put(self.tam_max, 610, 40) self.barra = BarraTodo(self) self.barra.set_size_request(690, 100) self.put(self.barra, 0, 70) msg_1 = "Instalar todo en una sola partición." self.option_1 = gtk.RadioButton(None, msg_1) self.option_1.connect("toggled", self.change_option, "ROOT:SWAP:LIBRE") self.option_1.set_size_request(350, 20) self.put(self.option_1, 0, 185) msg_2 = "Separar la partición /home (Recomendado)." self.option_2 = gtk.RadioButton(self.option_1, msg_2) self.option_2.connect("toggled", self.change_option, "ROOT:HOME:SWAP:LIBRE") self.option_2.set_size_request(350, 20) self.put(self.option_2, 0, 210) msg_3 = "Separar las particiones /home y /boot." self.option_3 = gtk.RadioButton(self.option_1, msg_3) self.option_3.connect("toggled", self.change_option, "BOOT:ROOT:HOME:SWAP:LIBRE") self.option_3.set_size_request(350, 20) self.put(self.option_3, 0, 235) msg_4 = "Separar /home, /boot, /var y /usr." self.option_4 = gtk.RadioButton(self.option_1, msg_4) self.option_4.connect("toggled", self.change_option, "BOOT:ROOT:VAR:USR:HOME:SWAP:LIBRE") self.option_4.set_size_request(350, 20) self.put(self.option_4, 0, 260) self.leyenda = Leyenda(self) self.leyenda.set_size_request(300, 150) self.put(self.leyenda, 390, 185) self.option_2.set_active(True) if self.metodo['tipo'] != 'TODO' and self.metodo['disco'][4] > 0: if self.metodo['part'][5] == 'primary': if self.metodo['disco'][3] == 0: # Disponibles: root+swap, root+home+swap self.option_3.set_sensitive(False) self.option_4.set_sensitive(False) elif self.metodo['disco'][3] == 1: # Disponibles: root+swap self.option_1.set_active(True) self.option_2.set_sensitive(False) self.option_3.set_sensitive(False) self.option_4.set_sensitive(False) elif self.metodo['part'][5] == 'logical': if self.metodo['disco'][5] == 7: # Disponibles: root+swap, root+home+swap, boot+root+home+swap self.option_4.set_sensitive(False) elif self.metodo['disco'][5] == 6: # Disponibles: root+swap, root+home+swap, boot+root+home+swap self.option_4.set_sensitive(False) elif self.metodo['disco'][5] == 8: # Disponibles: root+swap, root+home+swap self.option_3.set_sensitive(False) self.option_4.set_sensitive(False) elif self.metodo['disco'][5] == 9: # Disponibles: root+swap self.option_1.set_active(True) self.option_2.set_sensitive(False) self.option_3.set_sensitive(False) self.option_4.set_sensitive(False)