本文整理汇总了Python中lollypop.selectionlist.SelectionList.remove_value方法的典型用法代码示例。如果您正苦于以下问题:Python SelectionList.remove_value方法的具体用法?Python SelectionList.remove_value怎么用?Python SelectionList.remove_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lollypop.selectionlist.SelectionList
的用法示例。
在下文中一共展示了SelectionList.remove_value方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from lollypop.selectionlist import SelectionList [as 别名]
# 或者: from lollypop.selectionlist.SelectionList import remove_value [as 别名]
#.........这里部分代码省略.........
self.__stack.set_visible_child(child)
self.__stack.clean_old_views(child)
break
@property
def view(self):
"""
Disable overlays
"""
return self.__stack.get_visible_child()
@property
def progress(self):
"""
Progress bar
@return ProgressBar
"""
return self.__progress
def add_remove_from(self, value, list_one, add):
"""
Add or remove value to list
@param value as (int, str)
@param list one as bool
@param add as bool
"""
if list_one:
l = self.__list_one
else:
l = self.__list_two
if add:
l.add_value(value)
else:
l.remove_value(value[0])
def reload_view(self):
"""
Reload current view
"""
values_two = self.__list_two.selected_ids
values_one = self.__list_one.selected_ids
if not values_one:
values_one = [Type.POPULARS]
self.__list_one.select_ids([])
self.__list_one.clear()
self.__update_list_one(None)
self.__list_one.select_ids(values_one)
if self.__list_two.is_visible():
self.__list_two.select_ids([])
self.__list_two.clear()
self.__update_list_two(None)
self.__list_two.select_ids(values_two)
def pulse(self, pulse):
"""
Make progress bar visible/pulse if pulse is True
@param pulse as bool
"""
if pulse and not self.__progress.is_visible():
self.__progress.show()
if self.__pulse_timeout is None:
self.__pulse_timeout = GLib.timeout_add(500, self.__pulse)
else:
if self.__pulse_timeout is not None:
GLib.source_remove(self.__pulse_timeout)
self.__pulse_timeout = None