コード例 #1
0
 def _on_map_lastfm(self, widget, force=False):
     """
         Load on map
         @param widget as Gtk.Viewport
         @param force as bool
     """
     self._menu.hide()
     self._jump_button.hide()
     if self._current is None:
         self._current = self._get_current()
     names = []
     for artist_id in self._current[0]:
         names.append(Lp().artists.get_name(artist_id))
     artist = ", ".join(names)
     Lp().settings.set_value('infoswitch', GLib.Variant('s', 'lastfm'))
     content_widget = widget.get_child()
     if content_widget is None:
         content_widget = LastfmContent()
         content_widget.show()
         widget.add(content_widget)
     if force:
         content_widget.uncache(artist)
     if content_widget.should_update(artist) or force:
         content_widget.clear()
         t = Thread(target=content_widget.populate, args=(artist, ))
         t.daemon = True
         t.start()
コード例 #2
0
ファイル: pop_info.py プロジェクト: coconutlulz/lollypop
 def _on_map_lastfm(self, widget, force=False):
     """
         Load on map
         @param widget as Gtk.Viewport
         @param force as bool
     """
     self._menu.hide()
     self._jump_button.hide()
     if self._current is None:
         self._current = self._get_current()
     names = []
     for artist_id in self._current[0]:
         names.append(Lp().artists.get_name(artist_id))
     artist = ", ".join(names)
     Lp().settings.set_value('infoswitch',
                             GLib.Variant('s', 'lastfm'))
     content_widget = widget.get_child()
     if content_widget is None:
         content_widget = LastfmContent()
         content_widget.show()
         widget.add(content_widget)
     if force:
         content_widget.uncache(artist)
     if content_widget.should_update(artist) or force:
         content_widget.clear()
         t = Thread(target=content_widget.populate, args=(artist,))
         t.daemon = True
         t.start()
コード例 #3
0
ファイル: pop_infos.py プロジェクト: kenden/lollypop
 def _on_map_lastfm(self, widget, force=False):
     """
         Load on map
         @param widget as Gtk.Viewport
         @param force as bool
     """
     if not self.is_visible():
         return
     Lp.settings.set_value('infoswitch',
                           GLib.Variant('s', 'lastfm'))
     content_widget = widget.get_child()
     if content_widget is None:
         content_widget = LastfmContent()
         content_widget.show()
         widget.add(content_widget)
     if force:
         content_widget.uncache(self._artist)
     if content_widget.get_artist() != self._artist:
         content_widget.clear()
         t = Thread(target=content_widget.populate, args=(self._artist,))
         t.daemon = True
         t.start()
コード例 #4
0
ファイル: pop_infos.py プロジェクト: lesthack/lollypop
 def _on_map_lastfm(self, widget, force=False):
     """
         Load on map
         @param widget as Gtk.Viewport
         @param force as bool
     """
     self._menu.hide()
     if self._current is None:
         self._current = self._get_current()
     artist = Lp.artists.get_name(self._current[0])
     Lp.settings.set_value("infoswitch", GLib.Variant("s", "lastfm"))
     content_widget = widget.get_child()
     if content_widget is None:
         content_widget = LastfmContent()
         content_widget.show()
         widget.add(content_widget)
     if force:
         content_widget.uncache(artist)
     if content_widget.should_update(artist) or force:
         content_widget.clear()
         t = Thread(target=content_widget.populate, args=(artist,))
         t.daemon = True
         t.start()