def on_download_selected(self): current_path = self.cb.currentText() self.cb_remove(current_path) self.cb.insertItem(0, current_path) if current_path in self.paths_list: self.paths_list.remove(current_path) self.paths_list.append(current_path) if len(self.paths_list) > 5: self.paths_list.pop(0) self.cb.removeItem(5) self.cb.setCurrentIndex(0) conf.set_save_dl_paths(self.paths_list) id_items_list = [] iters = [] for row in self.items: if row[1]: # and row[4] != cons.UNSUPPORTED: #tmp iters.append(row) id_item = row[0] id_items_list.append(id_item) del self.rows_buffer[id_item] [self.__model.remove(self.items.index(iter)) for iter in iters] item_list = api.get_added_items(id_items_list) api.downloader_init(item_list, current_path) #iniciar threads de descarga. #TODO: use a signal. self.downloads.store_items(item_list)
def on_accept(self, widget): """""" save_to_path = self.entry.get_text().decode("utf-8") #(sys.getfilesystemencoding()) try: self.paths_list.remove(save_to_path) except ValueError: if len(self.paths_list) > 5: self.paths_list.pop(0) self.paths_list.append(save_to_path) self.paths_liststore.clear() self.load_save_paths() conf.set_save_dl_paths(self.paths_list) #remover items no seleccionados de pending_downloads. model = self.treeView.get_model() id_add_list = [] iters = [] for row in model: #desactivar los otros antes de activar este. if row[1] and row[2] != cons.LINK_DEAD and row[4] != cons.UNSUPPORTED: #id_col = 1, toggle. True (active) or False id_add_list.append(row[0]) iters.append(row.iter) #row.iter returns a treeiter [model.remove(iter) for iter in iters] item_list = api.get_added_items(id_add_list) api.downloader_init(item_list, save_to_path) #iniciar threads de descarga. self.list_gui.store_items(item_list) #agregar links a la lista GUI
def on_download_selected(self): current_path = self.cb.currentText() self.cb_remove(current_path) self.cb.insertItem(0, current_path) if current_path in self.paths_list: self.paths_list.remove(current_path) self.paths_list.append(current_path) if len(self.paths_list) > 5: self.paths_list.pop(0) self.cb.removeItem(5) self.cb.setCurrentIndex(0) conf.set_save_dl_paths(self.paths_list) id_items_list = [] iters = [] for row in self.items: if row[1]: # and row[4] != cons.UNSUPPORTED: #tmp iters.append(row) id_item = row[0] id_items_list.append(id_item) del self.rows_buffer[id_item] [self.__model.remove(self.items.index(iter)) for iter in iters] item_list = api.pop_checking_items(id_items_list) api.downloader_init(item_list, current_path) signals.store_items.emit(item_list) if conf.get_auto_switch_tab(): signals.switch_tab.emit(0)
def on_accept(self, widget): """""" save_to_path = self.entry.get_text().decode( "utf-8") #(sys.getfilesystemencoding()) try: self.paths_list.remove(save_to_path) except ValueError: if len(self.paths_list) > 5: self.paths_list.pop(0) self.paths_list.append(save_to_path) self.paths_liststore.clear() self.load_save_paths() conf.set_save_dl_paths(self.paths_list) #remover items no seleccionados de pending_downloads. model = self.treeView.get_model() id_add_list = [] iters = [] for row in model: #desactivar los otros antes de activar este. if row[1] and row[2] != cons.LINK_DEAD and row[ 4] != cons.UNSUPPORTED: #id_col = 1, toggle. True (active) or False id_add_list.append(row[0]) iters.append(row.iter) #row.iter returns a treeiter [model.remove(iter) for iter in iters] item_list = api.get_added_items(id_add_list) api.downloader_init(item_list, save_to_path) #iniciar threads de descarga. self.list_gui.store_items(item_list) #agregar links a la lista GUI