Esempio n. 1
0
 def _on_map_wikipedia(self, widget, force=False):
     """
         Load on map
         @param widget as Gtk.Viewport
         @param force as bool
     """
     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)
     # Get one album from artist
     if self._current[1] == Type.NONE:
         ids = Lp().artists.get_albums(self._current[0])
         if ids:
             album = Lp().albums.get_name(ids[0])
     else:
         album = Lp().albums.get_name(self._current[1])
     Lp().settings.set_value('infoswitch', GLib.Variant('s', 'wikipedia'))
     content_widget = widget.get_child()
     if content_widget is None:
         content_widget = WikipediaContent(self._menu)
         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, album))
         t.daemon = True
         t.start()
Esempio n. 2
0
 def _on_map_wikipedia(self, widget, force=False):
     """
         Load on map
         @param widget as Gtk.Viewport
         @param force as bool
     """
     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)
     # Get one album from artist
     if self._current[1] == Type.NONE:
         ids = Lp().artists.get_albums(self._current[0])
         if ids:
             album = Lp().albums.get_name(ids[0])
     else:
         album = Lp().albums.get_name(self._current[1])
     Lp().settings.set_value('infoswitch',
                             GLib.Variant('s', 'wikipedia'))
     content_widget = widget.get_child()
     if content_widget is None:
         content_widget = WikipediaContent(self._menu)
         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, album))
         t.daemon = True
         t.start()
Esempio n. 3
0
 def _on_map_wikipedia(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', 'wikipedia'))
     content_widget = widget.get_child()
     if content_widget is None:
         content_widget = WikipediaContent()
         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()
Esempio n. 4
0
 def _on_map_wikipedia(self, widget, force=False):
     """
         Load on map
         @param widget as Gtk.Viewport
         @param force as bool
     """
     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", "wikipedia"))
     content_widget = widget.get_child()
     if content_widget is None:
         content_widget = WikipediaContent(self._menu)
         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()