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 set_links(self): text = self.clipboard.text() if len(text) != self.len_old or text != self.text_old: urls = self.check_supported(self.check_text(text)) if urls: signals.add_downloads_to_check.emit(urls) signals.captured_links_count.emit(len(urls)) if conf.get_auto_switch_tab(): signals.switch_tab.emit(1) self.len_old = len(text) self.text_old = text
def load(self): if conf.get_tray_available(): self.tray_box.toggle() if conf.get_auto_switch_tab(): self.switch_tab_box.toggle()