本文整理汇总了Python中lollypop.selectionlist.SelectionList.set_mode方法的典型用法代码示例。如果您正苦于以下问题:Python SelectionList.set_mode方法的具体用法?Python SelectionList.set_mode怎么用?Python SelectionList.set_mode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lollypop.selectionlist.SelectionList
的用法示例。
在下文中一共展示了SelectionList.set_mode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from lollypop.selectionlist import SelectionList [as 别名]
# 或者: from lollypop.selectionlist.SelectionList import set_mode [as 别名]
#.........这里部分代码省略.........
dev.uri = uri
self._devices[self._devices_index] = dev
self._list_one.add_value((dev.id, dev.name))
def _remove_device(self, volume):
"""
Remove volume from device list
@param volume as Gio.Volume
"""
if volume is None:
return
root = volume.get_activation_root()
if root is None:
return
uri = root.get_uri()
for dev in self._devices.values():
if dev.uri == uri:
self._list_one.remove(dev.id)
child = self._stack.get_child_by_name(uri)
if child is not None:
child.destroy()
del self._devices[dev.id]
break
def _on_list_one_selected(self, selection_list):
"""
Update view based on selected object
@param list as SelectionList
"""
selected_ids = self._list_one.get_selected_ids()
if selected_ids[0] == Type.PLAYLISTS:
self._list_two.clear()
self._list_two.set_mode(Gtk.SelectionMode.SINGLE)
self._list_two.show()
if not self._list_two.will_be_selected():
self._update_view_playlists(None)
self._setup_list_playlists(False)
elif Type.DEVICES - 999 < selected_ids[0] < Type.DEVICES:
self._list_two.hide()
if not self._list_two.will_be_selected():
self._update_view_device(selected_ids[0])
elif selected_ids[0] in [Type.POPULARS,
Type.RECENTS,
Type.RANDOMS]:
self._list_two.hide()
self._update_view_albums(selected_ids)
elif selected_ids[0] == Type.RADIOS:
self._list_two.hide()
self._update_view_radios()
elif selection_list.is_marked_as_artists():
self._list_two.hide()
if selected_ids[0] == Type.ALL:
self._update_view_albums(selected_ids)
elif selected_ids[0] == Type.COMPILATIONS:
self._update_view_albums([], True)
else:
self._update_view_artists(selected_ids, [])
else:
self._list_two.clear()
self._list_two.set_mode(Gtk.SelectionMode.MULTIPLE)
self._setup_list_artists(self._list_two, selected_ids, False)
self._list_two.show()
if not self._list_two.will_be_selected():
self._update_view_albums(selected_ids, False)