def __init_monitor_images(self, add_system=False): if self.is_file_added: return items = [] image_paths = [] i = 0 self.set_loading(True) for image_path in common.walk_images(self.monitor_dir, filter_dir=self.filter_dir): image_paths.append(image_path) if add_system: system_deletes = get_system_deletes() for image_path in common.walk_images(self.system_wallpapper_dir): if not image_path in system_deletes: image_paths.append(image_path) while self.__image_index < len( image_paths) and i < self.SHOW_ITEM_COUNT: items.append(SelectItem(image_paths[self.__image_index])) self.__image_index += 1 i += 1 if items and items not in self.items: self.add_items(items) self.set_loading(False)
def __init_monitor_images(self, add_system=False): if self.is_file_added: return items = [] image_paths = [] i = 0 self.set_loading(True) for image_path in common.walk_images(self.monitor_dir, filter_dir = self.filter_dir): image_paths.append(image_path) if add_system: system_deletes = get_system_deletes() for image_path in common.walk_images(self.system_wallpapper_dir): if not image_path in system_deletes: image_paths.append(image_path) while self.__image_index < len(image_paths) and i < self.SHOW_ITEM_COUNT: items.append(SelectItem(image_paths[self.__image_index])) self.__image_index += 1 i += 1 if items and items not in self.items: self.add_items(items) self.set_loading(False)
def on_library_folder_added(self, obj, gfile): items = [] for image_path in common.walk_images(gfile.get_path(), filter_dir = self.filter_dir): if not self.is_exists(image_path): items.append(SelectItem(image_path)) if items: self.add_items(items)
def on_library_folder_added(self, obj, gfile): items = [] for image_path in common.walk_images(gfile.get_path(), filter_dir=self.filter_dir): if not self.is_exists(image_path): items.append(SelectItem(image_path)) if items: self.add_items(items)