本文整理汇总了Python中lollypop.selectionlist.SelectionList.select_id方法的典型用法代码示例。如果您正苦于以下问题:Python SelectionList.select_id方法的具体用法?Python SelectionList.select_id怎么用?Python SelectionList.select_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lollypop.selectionlist.SelectionList
的用法示例。
在下文中一共展示了SelectionList.select_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from lollypop.selectionlist import SelectionList [as 别名]
# 或者: from lollypop.selectionlist.SelectionList import select_id [as 别名]
#.........这里部分代码省略.........
@param list as SelectionList
@param object id as int
"""
def _on_list_one_selected(self, selection_list, object_id):
if object_id == Navigation.PLAYLISTS:
start_new_thread(self._setup_list_playlists, (False,))
self._list_two.widget.show()
elif object_id < Navigation.DEVICES:
self._list_two.widget.hide()
self._update_view_device(object_id)
elif object_id == Navigation.POPULARS:
self._list_two.widget.hide()
self._update_view_albums(object_id, None)
elif selection_list.is_marked_as_artists():
self._list_two.widget.hide()
if object_id == Navigation.ALL or\
object_id == Navigation.COMPILATIONS:
self._update_view_albums(object_id, None)
else:
self._update_view_artists(object_id, None)
else:
start_new_thread(self._setup_list_artists,
(self._list_two, object_id, False))
self._list_two.widget.show()
if self._list_two_restore is None:
self._update_view_albums(object_id, None)
"""
Restore previous state
@param selection list as SelectionList
"""
def _on_list_one_populated(self, selection_list):
if self._list_one_restore is not None:
self._list_one.select_id(self._list_one_restore)
self._list_one_restore = None
for dev in self._devices.values():
self._list_one.add_device(dev.name, dev.id)
"""
Update view based on selected object
@param list as SelectionList
@param object id as int
"""
def _on_list_two_selected(self, selection_list, object_id):
selected_id = self._list_one.get_selected_id()
if selected_id == Navigation.PLAYLISTS:
self._update_view_playlists(object_id)
elif object_id == Navigation.COMPILATIONS:
self._update_view_albums(object_id, selected_id)
else:
self._update_view_artists(object_id, selected_id)
"""
Restore previous state
@param selection list as SelectionList
"""
def _on_list_two_populated(self, selection_list):
if self._list_two_restore is not None:
self._list_two.select_id(self._list_two_restore)
self._list_two_restore = None
"""
Play tracks as user playlist
@param scanner as collection scanner
@param outdb as bool (tracks not present in db)
"""