def __init__(self, add_Downloads_gui): """""" gtk.Statusbar.__init__(self) self.update_manager = api.start_update_manager() self.add_Downloads_gui = add_Downloads_gui hbox = gtk.HBox(False, 10) #Slots limit label_slots = gtk.Label(_("Slots limit:")) hbox.pack_start(label_slots, False, False) self.max_slots = gtk.SpinButton(None, 1, 0) self.max_slots.set_property("shadow-type", gtk.SHADOW_NONE) self.max_slots.set_range(1, 20) self.max_slots.set_increments(1, 1) self.max_slots.set_value(DEFAULT_SLOTS) self.max_slots.set_numeric(True) api.new_slot_limit(DEFAULT_SLOTS) #self.max_speed.set_value() hbox.pack_start(self.max_slots, False, False) self.max_slots.connect("value-changed", self.change_slots) #Speed limit label_speed = gtk.Label(_("Speed limit:")) hbox.pack_start(label_speed, False, False) self.max_speed = gtk.SpinButton(None, 4, 0) self.max_speed.set_property("shadow-type", gtk.SHADOW_NONE) self.max_speed.set_range(0, 5000) self.max_speed.set_increments(10, 0) self.max_speed.set_numeric(True) #self.max_speed.set_value() hbox.pack_start(self.max_speed, False, False) self.max_speed.connect("value-changed", self.change_speed) self.pack_start(hbox, False, False) #update check. self.msg_id = self.push_msg( _("Update checking...")) #push(id, message) gobject.timeout_add( 2000, self.update_check) #auto actualizar status cada 1 seg. self.show_all()
def __init__(self, add_Downloads_gui): """""" gtk.Statusbar.__init__(self) self.update_manager = api.start_update_manager() self.add_Downloads_gui = add_Downloads_gui hbox = gtk.HBox(False, 10) #Slots limit label_slots = gtk.Label(_("Slots limit:")) hbox.pack_start(label_slots, False, False) self.max_slots = gtk.SpinButton(None, 1, 0) self.max_slots.set_property("shadow-type", gtk.SHADOW_NONE) self.max_slots.set_range(1, 20) self.max_slots.set_increments(1, 1) self.max_slots.set_value(DEFAULT_SLOTS) self.max_slots.set_numeric(True) api.new_slot_limit(DEFAULT_SLOTS) #self.max_speed.set_value() hbox.pack_start(self.max_slots, False, False) self.max_slots.connect("value-changed", self.change_slots) #Speed limit label_speed = gtk.Label(_("Speed limit:")) hbox.pack_start(label_speed, False, False) self.max_speed = gtk.SpinButton(None, 4, 0) self.max_speed.set_property("shadow-type", gtk.SHADOW_NONE) self.max_speed.set_range(0, 5000) self.max_speed.set_increments(10, 0) self.max_speed.set_numeric(True) #self.max_speed.set_value() hbox.pack_start(self.max_speed, False, False) self.max_speed.connect("value-changed", self.change_speed) self.pack_start(hbox, False, False) #update check. self.msg_id = self.push_msg(_("Update checking...")) #push(id, message) gobject.timeout_add(2000, self.update_check) #auto actualizar status cada 1 seg. self.show_all()
def change_slots(self, spinbutton): """""" limit = spinbutton.get_value_as_int() api.new_slot_limit(limit)
def on_load(self): DEFAULT_SLOTS = 3 self.slots_box.setValue(DEFAULT_SLOTS) api.new_slot_limit(DEFAULT_SLOTS)
def on_slots_changed(self, new_value): api.new_slot_limit(new_value)